From c7d4012fc9ab678168a7418d962fa7b8b9163ceb Mon Sep 17 00:00:00 2001 From: Zhang Rui Date: Sat, 28 Feb 2026 14:04:26 +0800 Subject: [PATCH] fix(wecom-aibot): correct variable name in JSON parsing in message callback handler --- pkg/channels/wecom/aibot.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/channels/wecom/aibot.go b/pkg/channels/wecom/aibot.go index c2f98806b..115fde9f7 100644 --- a/pkg/channels/wecom/aibot.go +++ b/pkg/channels/wecom/aibot.go @@ -351,9 +351,9 @@ func (c *WeComAIBotChannel) handleMessageCallback( var encryptedMsg struct { Encrypt string `json:"encrypt"` } - if err := json.Unmarshal(body, &encryptedMsg); err != nil { + if unmarshalErr := json.Unmarshal(body, &encryptedMsg); unmarshalErr != nil { logger.ErrorCF("wecom_aibot", "Failed to parse JSON body", map[string]any{ - "error": err, + "error": unmarshalErr, "body": string(body), }) http.Error(w, "Failed to parse JSON", http.StatusBadRequest)