MCPcopy
hub / github.com/ConnectAI-E/feishu-openai / replyCard

Function replyCard

code/handlers/msg.go:55–81  ·  view source on GitHub ↗
(ctx context.Context,
	msgId *string,
	cardContent string,
)

Source from the content-addressed store, hash-verified

53}
54
55func replyCard(ctx context.Context,
56 msgId *string,
57 cardContent string,
58) error {
59 client := initialization.GetLarkClient()
60 resp, err := client.Im.Message.Reply(ctx, larkim.NewReplyMessageReqBuilder().
61 MessageId(*msgId).
62 Body(larkim.NewReplyMessageReqBodyBuilder().
63 MsgType(larkim.MsgTypeInteractive).
64 Uuid(uuid.New().String()).
65 Content(cardContent).
66 Build()).
67 Build())
68
69 // 处理错误
70 if err != nil {
71 fmt.Println(err)
72 return err
73 }
74
75 // 服务端错误处理
76 if !resp.Success() {
77 logger.Errorf("服务端错误 resp code[%v], msg [%v] requestId [%v] ", resp.Code, resp.Msg, resp.RequestId())
78 return errors.New(resp.Msg)
79 }
80 return nil
81}
82
83func newSendCard(
84 header *larkcard.MessageCardHeader,

Callers 15

sendClearCacheCheckCardFunction · 0.85
sendPicModeCheckCardFunction · 0.85
sendVisionModeCheckCardFunction · 0.85
sendNewTopicCardFunction · 0.85
sendOldTopicCardFunction · 0.85
sendVisionTopicCardFunction · 0.85
sendHelpCardFunction · 0.85
sendImageCardFunction · 0.85
sendVarImageCardFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected