mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-06-02 00:57:41 +08:00
fix: remove channel restrictions
This commit is contained in:
@@ -117,33 +117,23 @@ class WechatChannel(ChatChannel):
|
|||||||
|
|
||||||
def startup(self):
|
def startup(self):
|
||||||
try:
|
try:
|
||||||
time.sleep(3)
|
itchat.instance.receivingRetryCount = 600 # 修改断线超时时间
|
||||||
logger.error("""[WechatChannel] 当前channel暂不可用,目前支持的channel有:
|
# login by scan QRCode
|
||||||
1. terminal: 终端
|
hotReload = conf().get("hot_reload", False)
|
||||||
2. wechatmp: 个人公众号
|
status_path = os.path.join(get_appdata_dir(), "itchat.pkl")
|
||||||
3. wechatmp_service: 企业公众号
|
itchat.auto_login(
|
||||||
4. wechatcom_app: 企微自建应用
|
enableCmdQR=2,
|
||||||
5. dingtalk: 钉钉
|
hotReload=hotReload,
|
||||||
6. feishu: 飞书
|
statusStorageDir=status_path,
|
||||||
7. web: 网页
|
qrCallback=qrCallback,
|
||||||
可修改 config.json 配置文件的 channel_type 字段进行切换""")
|
exitCallback=self.exitCallback,
|
||||||
# itchat.instance.receivingRetryCount = 600 # 修改断线超时时间
|
loginCallback=self.loginCallback
|
||||||
# # login by scan QRCode
|
)
|
||||||
# hotReload = conf().get("hot_reload", False)
|
self.user_id = itchat.instance.storageClass.userName
|
||||||
# status_path = os.path.join(get_appdata_dir(), "itchat.pkl")
|
self.name = itchat.instance.storageClass.nickName
|
||||||
# itchat.auto_login(
|
logger.info("Wechat login success, user_id: {}, nickname: {}".format(self.user_id, self.name))
|
||||||
# enableCmdQR=2,
|
# start message listener
|
||||||
# hotReload=hotReload,
|
itchat.run()
|
||||||
# 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:
|
except Exception as e:
|
||||||
logger.exception(e)
|
logger.exception(e)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user