parent
07cd943fda
commit
268be39dc1
|
|
@ -281,7 +281,7 @@ func (cli *StreamClient) GetConnectionEndpoint(ctx context.Context) (*payload.Co
|
|||
}
|
||||
|
||||
for ttype, subs := range cli.subscriptions {
|
||||
for ttopic, _ := range subs {
|
||||
for ttopic := range subs {
|
||||
requestModel.Subscriptions = append(requestModel.Subscriptions, &payload.SubscriptionModel{
|
||||
Type: ttype,
|
||||
Topic: ttopic,
|
||||
|
|
|
|||
|
|
@ -23,8 +23,12 @@ func OnChatBotMessageReceived(ctx context.Context, data *chatbot.BotCallbackData
|
|||
replyMsg := []byte(fmt.Sprintf("msg received: [%s]", data.Text.Content))
|
||||
|
||||
chatbotReplier := chatbot.NewChatbotReplier()
|
||||
chatbotReplier.SimpleReplyText(ctx, data.SessionWebhook, replyMsg)
|
||||
chatbotReplier.SimpleReplyMarkdown(ctx, data.SessionWebhook, []byte("Markdown消息"), replyMsg)
|
||||
if err := chatbotReplier.SimpleReplyText(ctx, data.SessionWebhook, replyMsg); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := chatbotReplier.SimpleReplyMarkdown(ctx, data.SessionWebhook, []byte("Markdown消息"), replyMsg); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return []byte(""), nil
|
||||
}
|
||||
|
|
@ -59,7 +63,9 @@ func OnEventReceived(ctx context.Context, df *payload.DataFrame) (frameResp *pay
|
|||
df.Data)
|
||||
|
||||
frameResp = payload.NewSuccessDataFrameResponse()
|
||||
frameResp.SetJson(event.NewEventProcessResultSuccess())
|
||||
if err := frameResp.SetJson(event.NewEventProcessResultSuccess()); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,8 @@ func (h *DefaultPluginFrameHandler) OnEventReceived(ctx context.Context, df *pay
|
|||
pluginResponse := &PluginResponse{RequestId: msgData.RequestId, Result: result}
|
||||
callbackResponse := &CallbackResponse{Response: pluginResponse}
|
||||
frameResp := payload.NewSuccessDataFrameResponse()
|
||||
frameResp.SetJson(callbackResponse)
|
||||
if err = frameResp.SetJson(callbackResponse); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return frameResp, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue