Update pkg/channels/wecom/aibot.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
ZHANG RUIandCopilot authored and Zhang Rui committed 2026-03-02 17:42:54 +08:00
1 parent 4a87090fd9
commit e88b39f21e
1 file changed
+5 -2
+5 -2
View File
@@ -928,9 +928,12 @@ func (c *WeComAIBotChannel) encryptResponse(
return string(respJSON)
}
// encryptEmptyResponse returns empty encrypted response
// encryptEmptyResponse returns a minimal valid encrypted response
func (c *WeComAIBotChannel) encryptEmptyResponse(timestamp, nonce string) string {
return ""
// Construct a zero-value stream response and encrypt it so that
// WeCom always receives a syntactically valid encrypted JSON object.
emptyResp := WeComAIBotStreamResponse{}
return c.encryptResponse("", timestamp, nonce, emptyResp)
}
// encryptMessage encrypts a plain text message for WeCom AI Bot