@@ -117,23 +117,33 @@ def __init__(self):
117117
118118 def startup (self ):
119119 try :
120- itchat .instance .receivingRetryCount = 600 # 修改断线超时时间
121- # login by scan QRCode
122- hotReload = conf ().get ("hot_reload" , False )
123- status_path = os .path .join (get_appdata_dir (), "itchat.pkl" )
124- itchat .auto_login (
125- enableCmdQR = 2 ,
126- hotReload = hotReload ,
127- statusStorageDir = status_path ,
128- qrCallback = qrCallback ,
129- exitCallback = self .exitCallback ,
130- loginCallback = self .loginCallback
131- )
132- self .user_id = itchat .instance .storageClass .userName
133- self .name = itchat .instance .storageClass .nickName
134- logger .info ("Wechat login success, user_id: {}, nickname: {}" .format (self .user_id , self .name ))
135- # start message listener
136- itchat .run ()
120+ time .sleep (3 )
121+ logger .error ("""[WechatChannel] 当前channel暂不可用,目前支持的channel有:
122+ 1. terminal: 终端
123+ 2. wechatmp: 个人公众号
124+ 3. wechatmp_service: 企业公众号
125+ 4. wechatcom_app: 企微自建应用
126+ 5. dingtalk: 钉钉
127+ 6. feishu: 飞书
128+ 7. web: 网页
129+ 可修改 config.json 配置文件的 channel_type 字段进行切换""" )
130+ # itchat.instance.receivingRetryCount = 600 # 修改断线超时时间
131+ # # login by scan QRCode
132+ # hotReload = conf().get("hot_reload", False)
133+ # status_path = os.path.join(get_appdata_dir(), "itchat.pkl")
134+ # itchat.auto_login(
135+ # enableCmdQR=2,
136+ # hotReload=hotReload,
137+ # statusStorageDir=status_path,
138+ # qrCallback=qrCallback,
139+ # exitCallback=self.exitCallback,
140+ # loginCallback=self.loginCallback
141+ # )
142+ # self.user_id = itchat.instance.storageClass.userName
143+ # self.name = itchat.instance.storageClass.nickName
144+ # logger.info("Wechat login success, user_id: {}, nickname: {}".format(self.user_id, self.name))
145+ # # start message listener
146+ # itchat.run()
137147 except Exception as e :
138148 logger .exception (e )
139149
0 commit comments