fix: wecom bot callback message is xml
This commit is contained in:
parent
4768edc67b
commit
f135161377
1 changed files with 2 additions and 1 deletions
|
|
@ -297,8 +297,9 @@ func (c *WeComBotChannel) handleMessageCallback(ctx context.Context, w http.Resp
|
|||
}
|
||||
|
||||
// Parse decrypted JSON message (AIBOT uses JSON format)
|
||||
// Reference: https://developer.work.weixin.qq.com/document/path/90968#%E4%B8%BE%E4%BE%8B%E8%AF%B4%E6%98%8E
|
||||
var msg WeComBotMessage
|
||||
if err := json.Unmarshal([]byte(decryptedMsg), &msg); err != nil {
|
||||
if err := xml.Unmarshal([]byte(decryptedMsg), &msg); err != nil {
|
||||
logger.ErrorCF("wecom", "Failed to parse decrypted message", map[string]any{
|
||||
"error": err.Error(),
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue