From 1e58c1ad2ba61bc20223afa568e92a0f0aa0205e Mon Sep 17 00:00:00 2001 From: JS00000 Date: Thu, 20 Apr 2023 04:35:06 +0800 Subject: [PATCH] fix: wechatmp channel now do not need client --- channel/wechatmp/README.md | 6 +++--- channel/wechatmp/wechatmp_channel.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/channel/wechatmp/README.md b/channel/wechatmp/README.md index 12b429d..8ace25b 100644 --- a/channel/wechatmp/README.md +++ b/channel/wechatmp/README.md @@ -20,10 +20,10 @@ pip3 install web.py 相关的服务器验证代码已经写好,你不需要再添加任何代码。你只需要在本项目根目录的`config.json`中添加 ``` "channel_type": "wechatmp", # 如果通过了微信认证,将"wechatmp"替换为"wechatmp_service",可极大的优化使用体验 -"wechatmp_token": "Token", # 微信公众平台的Token +"wechatmp_token": "xxxx", # 微信公众平台的Token "wechatmp_port": 8080, # 微信公众平台的端口,需要端口转发到80或443 -"wechatmp_app_id": "", # 微信公众平台的appID,wechatmp_service需要填写 -"wechatmp_app_secret": "", # 微信公众平台的appsecret,wechatmp_service需要填写 +"wechatmp_app_id": "xxxx", # 微信公众平台的appID +"wechatmp_app_secret": "xxxx", # 微信公众平台的appsecret "single_chat_prefix": [""], # 推荐设置,任意对话都可以触发回复,不添加前缀 "single_chat_reply_prefix": "", # 推荐设置,回复不设置前缀 "plugin_trigger_prefix": "&", # 推荐设置,在手机微信客户端中,$%^等符号与中文连在一起时会自动显示一段较大的间隔,用户体验不好。请不要使用管理员指令前缀"#",这会造成未知问题。 diff --git a/channel/wechatmp/wechatmp_channel.py b/channel/wechatmp/wechatmp_channel.py index 48ef14e..74e6e25 100644 --- a/channel/wechatmp/wechatmp_channel.py +++ b/channel/wechatmp/wechatmp_channel.py @@ -27,7 +27,6 @@ class WechatMPChannel(ChatChannel): self.passive_reply = passive_reply self.flag = 0 - self.client = WechatMPClient() if self.passive_reply: self.NOT_SUPPORT_REPLYTYPE = [ReplyType.IMAGE, ReplyType.VOICE] # Cache the reply to the user's first message @@ -38,6 +37,7 @@ class WechatMPChannel(ChatChannel): self.request_cnt = dict() else: self.NOT_SUPPORT_REPLYTYPE = [] + self.client = WechatMPClient() def startup(self):