mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-17 09:56:06 +00:00
移除有一处将数据当作base64处理并通过unknown中content(但是没有啊)传递。
This commit is contained in:
@@ -219,18 +219,20 @@ class GewechatMessageConverter(adapter.MessageConverter):
|
|||||||
)
|
)
|
||||||
# print(data_type.text)
|
# print(data_type.text)
|
||||||
else:
|
else:
|
||||||
|
return platform_message.MessageChain(
|
||||||
|
[platform_message.Unknown(text=content)]
|
||||||
try:
|
|
||||||
content_bytes = content.encode('utf-8')
|
|
||||||
decoded_content = base64.b64decode(content_bytes)
|
|
||||||
return platform_message.MessageChain(
|
|
||||||
[platform_message.Unknown(text=decoded_content)]
|
|
||||||
) # 不对劲,十分有九分不对劲这里这么写不对吧
|
|
||||||
except Exception as e:
|
|
||||||
return platform_message.MessageChain(
|
|
||||||
[platform_message.Plain(text=content)]
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# try:
|
||||||
|
# content_bytes = content.encode('utf-8')
|
||||||
|
# decoded_content = base64.b64decode(content_bytes)
|
||||||
|
# return platform_message.MessageChain(
|
||||||
|
# [platform_message.Unknown(content=decoded_content)]
|
||||||
|
# ) # unknown中没有content
|
||||||
|
# except Exception as e:
|
||||||
|
# return platform_message.MessageChain(
|
||||||
|
# [platform_message.Plain(text=content)]
|
||||||
|
# )
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error processing type 49 message: {str(e)}")
|
print(f"Error processing type 49 message: {str(e)}")
|
||||||
return platform_message.MessageChain(
|
return platform_message.MessageChain(
|
||||||
|
|||||||
Reference in New Issue
Block a user