From ac628b26d91a0cc19381474e04a53e77890c65c0 Mon Sep 17 00:00:00 2001 From: wangcham Date: Mon, 10 Feb 2025 09:16:33 -0500 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9Aadd=20support=20for=20wechat=20off?= =?UTF-8?q?icial=20account?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/official_account_api/api.py | 15 ++++++++------- templates/platform.json | 10 ++++++++++ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/libs/official_account_api/api.py b/libs/official_account_api/api.py index 92ba47e5..0ed4d8b4 100644 --- a/libs/official_account_api/api.py +++ b/libs/official_account_api/api.py @@ -106,13 +106,14 @@ class OAClient(): if self.msg_id_map.get(message_data["MsgId"], 1) == 3: - response_xml = xml_template.format( - to_user=from_user, - from_user=to_user, - create_time=int(time.time()), - content = "请求失效:暂不支持公众号超过15秒的请求,如有需求,请联系 LangBot 团队。" - ) - return response_xml + # response_xml = xml_template.format( + # to_user=from_user, + # from_user=to_user, + # create_time=int(time.time()), + # content = "请求失效:暂不支持公众号超过15秒的请求,如有需求,请联系 LangBot 团队。" + # ) + print("请求失效:暂不支持公众号超过15秒的请求,如有需求,请联系 LangBot 团队。") + return '' except Exception as e: traceback.print_exc() diff --git a/templates/platform.json b/templates/platform.json index 8676cf99..5a1fca77 100644 --- a/templates/platform.json +++ b/templates/platform.json @@ -65,6 +65,16 @@ "callback_url": "http://your-callback-url:2286/gewechat/callback", "app_id": "", "token": "" + }, + { + "adapter":"officialaccount", + "enable": true, + "token": "", + "EncodingAESKey":"", + "AppSecret":"", + "AppID":"", + "host": "0.0.0.0", + "port": 2287 } ], "track-function-calls": true,