fix: lint

Signed-off-by: ashing <axingfly@gmail.com>
This commit is contained in:
ashing 2023-09-02 14:11:41 +08:00
parent 07cd943fda
commit 268be39dc1
No known key found for this signature in database
GPG Key ID: 2BCC25521D62F34C
3 changed files with 13 additions and 5 deletions

View File

@ -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,

View File

@ -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
}

View File

@ -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
}