Update pkg/channels/wecom/aibot.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
ZHANG RUI
2026-02-28 15:54:00 +08:00
committed by Zhang Rui
parent 4a87090fd9
commit e88b39f21e
+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