From cb7f7b80df05af17a9ab0c7bca0fb2b3fdc4172d Mon Sep 17 00:00:00 2001 From: Dong_master <2213070223@qq.com> Date: Thu, 24 Apr 2025 22:05:54 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=9C=89=E4=B8=80=E5=A4=84?= =?UTF-8?q?=E5=B0=86=E6=95=B0=E6=8D=AE=E5=BD=93=E4=BD=9Cbase64=E5=A4=84?= =?UTF-8?q?=E7=90=86=E5=B9=B6=E9=80=9A=E8=BF=87unknown=E4=B8=ADcontent(?= =?UTF-8?q?=E4=BD=86=E6=98=AF=E6=B2=A1=E6=9C=89=E5=95=8A)=E4=BC=A0?= =?UTF-8?q?=E9=80=92=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/platform/sources/gewechat.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/pkg/platform/sources/gewechat.py b/pkg/platform/sources/gewechat.py index da4a6b99..06e1378b 100644 --- a/pkg/platform/sources/gewechat.py +++ b/pkg/platform/sources/gewechat.py @@ -219,18 +219,20 @@ class GewechatMessageConverter(adapter.MessageConverter): ) # print(data_type.text) else: - - - 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)] + 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(content=decoded_content)] + # ) # unknown中没有content + # except Exception as e: + # return platform_message.MessageChain( + # [platform_message.Plain(text=content)] + # ) except Exception as e: print(f"Error processing type 49 message: {str(e)}") return platform_message.MessageChain(