From 436c038a2f090c04b00e6c0a39b05973a1014bf1 Mon Sep 17 00:00:00 2001 From: Saboteur7 Date: Wed, 5 Feb 2025 12:25:30 +0800 Subject: [PATCH] fix: temporarily remove unavailable channels --- channel/wechat/wechat_channel.py | 44 ++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/channel/wechat/wechat_channel.py b/channel/wechat/wechat_channel.py index ce3f086..3f5286b 100644 --- a/channel/wechat/wechat_channel.py +++ b/channel/wechat/wechat_channel.py @@ -117,23 +117,33 @@ class WechatChannel(ChatChannel): def startup(self): try: - itchat.instance.receivingRetryCount = 600 # 修改断线超时时间 - # login by scan QRCode - hotReload = conf().get("hot_reload", False) - status_path = os.path.join(get_appdata_dir(), "itchat.pkl") - itchat.auto_login( - enableCmdQR=2, - hotReload=hotReload, - statusStorageDir=status_path, - qrCallback=qrCallback, - exitCallback=self.exitCallback, - loginCallback=self.loginCallback - ) - self.user_id = itchat.instance.storageClass.userName - self.name = itchat.instance.storageClass.nickName - logger.info("Wechat login success, user_id: {}, nickname: {}".format(self.user_id, self.name)) - # start message listener - itchat.run() + time.sleep(3) + logger.error("""[WechatChannel] 当前channel暂不可用,目前支持的channel有: + 1. terminal: 终端 + 2. wechatmp: 个人公众号 + 3. wechatmp_service: 企业公众号 + 4. wechatcom_app: 企微自建应用 + 5. dingtalk: 钉钉 + 6. feishu: 飞书 + 7. web: 网页 + 可修改 config.json 配置文件的 channel_type 字段进行切换""") + # itchat.instance.receivingRetryCount = 600 # 修改断线超时时间 + # # login by scan QRCode + # hotReload = conf().get("hot_reload", False) + # status_path = os.path.join(get_appdata_dir(), "itchat.pkl") + # itchat.auto_login( + # enableCmdQR=2, + # hotReload=hotReload, + # statusStorageDir=status_path, + # qrCallback=qrCallback, + # exitCallback=self.exitCallback, + # loginCallback=self.loginCallback + # ) + # self.user_id = itchat.instance.storageClass.userName + # self.name = itchat.instance.storageClass.nickName + # logger.info("Wechat login success, user_id: {}, nickname: {}".format(self.user_id, self.name)) + # # start message listener + # itchat.run() except Exception as e: logger.exception(e)