zhayujie / bot-on-anything

Connect AI models (like ChatGPT-3.5/4.0, Baidu Yiyan, New Bing, Bard) to apps (like Wechat, public account, DingTalk, Telegram, QQ). 将 ChatGPT、必应、文心一言、谷歌Bard 等对话模型连接各类应用,如微信、公众号、QQ、Telegram、Gmail、Slack、Web、企业微信、飞书、钉钉等。
MIT License
3.95k stars 915 forks source link

钉钉版本后台消息没有发回来 #289

Open gwailee opened 1 year ago

gwailee commented 1 year ago

分别获得群里的机器人的webhoot的access_token和应用的APP_screte,分别填写到里面: 样式是这样的: "dingtalk_token": "6d3019c62c8sgsdge9378a48e5e7308c94a3737b8510a1a0f850d222232a", "dingtalk_post_token": "", "dingtalk_secret": "QWuhV97bFzhvQcysdggsd6zGN4gjm-vamljp2Ua15jvFmsjlUlKsD--7m0HQQY" 我也做了反向代理,也就是80》8081端口,后台能看到正常回复,但是没有返回到群里面来,这是什么问题?

gwailee commented 1 year ago

后台信息:[INFO][2023-04-10 08:46:22][log.py:32] - [DingTalk] chat=b'{"conversationId":"cidVgTPqI==","atUsers":[{"dingtalkId":"$:LWCP_v1:$6QY85yFMlQw1u/z0/j5EPvV+RBZC5FtP"}],"chatbotUserId":"$:LWCP_v1:$6QY85yFMlQw1u/z0/j5EPvV+RBZC5FtP","msgId":"msgOvUoZRLdf3M/9NYFQ==","senderNick":"Kevin LEE","isAdmin":false,"sessionWebhookExpiredTime":1681121782033,"createAt":1681116381863,"conversationType":"2","senderId":"$:LWCP_v1:$YacuFu+2s3OfBli4DRw==","conversationTitle":"CG\xe6\x9c\xba\xe5\x99\xa8\xe4\xba\xba-TEST","isInAtList":true,"sessionWebhook":"https://oapi.dingtalk.com/robot/sendBySession?session=82fe9b949f3706da7865d047ad174f01","text":{"content":" \xe4\xbd\xa0\xe5\xa5\xbd"},"robotCode":"normal","msgtype":"text"}' [INFO][2023-04-10 08:46:22][log.py:32] - [CHATGPT] api_base=None proxy= [INFO][2023-04-10 08:46:22][log.py:32] - [CHATGPT] query= 你好 [INFO][2023-04-10 08:46:24][log.py:34] - [CHATGPT] reply=你好,请问有什么我可以帮助你的问题吗? 127.0.0.1 - - [10/Apr/2023 08:46:25] "POST / HTTP/1.1" 200 -

kyrieljy commented 1 year ago

消息接收地址填了吗

ytanck commented 1 year ago

INFO][2023-04-15 17:01:32][log.py:32] - [DingTalk] chat=b'{"conversationId":"cidyHavy5PT/pLeQL8J3WZCeA==","atUsers":[{"dingtalkId":"$:LWCP_v1:$adAif2aWwQFVWgvilX2s7HZ4QskpGZ"}],"chatbotUserId":"$:LWCP_v1:$adAif2aWwVWgvilX2s7HZ4QPjskpGZ","msgId":"msgk8RX2XWf/oezDCembESs9Q==","senderNick":"\xe6\xa8\xe6\xb6\x9b","isAdmin":false,"sessionWebhookExpiredTime":1681554691970,"createAt":1681549291058,"conversationType":"2","senderId":"$:LWCP_v1:$bVK8ELp4+2foinwrDH2btA==","conversationTitle":"ytmos-TEST","isInAtList":true,"sessionWebhook":"https://oapi.dingtalk.com/robot/sendBySession?session=8ddc923b902dcf98fcc92bbbcbe3d","text":{"content":" 555"},"robotCode":"normal","msgtype":"text"}' 203.119.241.97 - - [15/Apr/2023 17:01:32] "POST / HTTP/1.1" 200 - 服务器能收到消息,但是没有下文了,没有回复消息,何解?

just1900 commented 1 year ago

可以加上debug log 看下报错 https://github.com/zhayujie/bot-on-anything/blob/a3a412ca0b62bac798665ddba78b51eabd7a7792/channel/dingtalk/dingtalk_channel.py#L55

我的情况是 reply={'errcode': 310000, 'errmsg': '错误描述:关键词不匹配;解决方案:请联系群管理员查看此机器人的关键词,并在发送的信息中包含此关键词;'}

需要在调试群测试的时候,把机器人里安全设置的自定义关键词改掉.