mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-11 16:26:02 +00:00
Merge pull request #1162 from fdc310/master
'修复了gewe更新回调参数data和typename字段改变造成的不回复的问题'
This commit is contained in:
@@ -226,11 +226,16 @@ class GeWeChatAdapter(adapter.MessagePlatformAdapter):
|
|||||||
@self.quart_app.route('/gewechat/callback', methods=['POST'])
|
@self.quart_app.route('/gewechat/callback', methods=['POST'])
|
||||||
async def gewechat_callback():
|
async def gewechat_callback():
|
||||||
data = await quart.request.json
|
data = await quart.request.json
|
||||||
|
|
||||||
|
|
||||||
|
if data['data']:
|
||||||
|
data['Data'] = data['data']
|
||||||
# print(json.dumps(data, indent=4, ensure_ascii=False))
|
# print(json.dumps(data, indent=4, ensure_ascii=False))
|
||||||
|
|
||||||
|
|
||||||
if 'testMsg' in data:
|
if 'testMsg' in data:
|
||||||
return 'ok'
|
return 'ok'
|
||||||
elif 'TypeName' in data and data['TypeName'] == 'AddMsg':
|
elif 'TypeName' in data and data['TypeName'] or data['type_name'] == 'AddMsg':
|
||||||
try:
|
try:
|
||||||
|
|
||||||
event = await self.event_converter.target2yiri(data.copy(), self.bot_account_id)
|
event = await self.event_converter.target2yiri(data.copy(), self.bot_account_id)
|
||||||
@@ -248,7 +253,7 @@ class GeWeChatAdapter(adapter.MessagePlatformAdapter):
|
|||||||
target_id: str,
|
target_id: str,
|
||||||
message: platform_message.MessageChain
|
message: platform_message.MessageChain
|
||||||
):
|
):
|
||||||
geweap_msg = await GewechatMessageConverter.yiri2target(message)
|
geweap_msg = await self.message_converter.yiri2target(message)
|
||||||
# 此处加上群消息at处理
|
# 此处加上群消息at处理
|
||||||
# ats = [item["target"] for item in geweap_msg if item["type"] == "at"]
|
# ats = [item["target"] for item in geweap_msg if item["type"] == "at"]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user