微信:是否可以在注销事件时重新触发登录? [英] Wechaty: possible to re-trigger login on logout event?
问题描述
我从wechaty-puppet-puppeteer
切换到微信padplus
木偶,发现它比wechaty-puppet-puppeteer
停止的频率更高.也就是说,wechaty-puppet-puppeteer
通常停留时间长10倍,而padplus木偶则每两三天将我注销一次.
I switched to wechaty padplus
puppet from the wechaty-puppet-puppeteer
and found it stops more often than wechaty-puppet-puppeteer
. I.e., wechaty-puppet-puppeteer
normally stays up 10 times longer while padplus puppet logs me out ever two or three days.
更新:
要澄清阿尔弗雷德(Alfred)的答案,
To give clarification for Alfred's answer,
我不认为这主要是因为我的微信帐户状态不佳.我相信是因为我的机器人完全没有与wx服务器进行交互.也就是说,它只是坐在那里,存档我收到的所有重要邮件,将它们保存到文件中,同时过滤掉不重要的邮件.因此,从WX服务器的角度来看,它无法告诉/判断我的机器人是否存在.
I don't think it is mainly because that my wechat account status is not good. I believe so because my bot has not interaction with wx server at all. I.e., it just sit there archiving all important messages that I received, saving them to files while filtering out the unimportant ones. So from the WX server point of view, there is no way for it to tell/judge whether my bot exist or not.
但是,确实有一点不同,从wechaty-puppet-puppeteer
切换到微信padplus
人偶,是当我发送新的一天的消息时,或者当我没有发送任何消息的时候,我注意到了一会儿,我会立即得到以下信息:
However, there is indeed one thing different, having switched to wechaty padplus
puppet from the wechaty-puppet-puppeteer
, is that I noticed whenever I sent a message for a new day, or when I haven't sent anything for quite a while, I will immediately get the following:
<sysmsg type="ClientCheckConsistency"><ClientCheckConsistency><clientcheck><fullpathfilename>@classes.dex</fullpathfilename><fileoffset>0</fileoffset><checkbuffersize>9999999</checkbuffersize><seq>536870912</seq></clientcheck></ClientCheckConsistency></sysmsg>
我不知道它来自WX服务器还是padplus
服务器,也不知道如何满足这样的ClientCheckConsistency
.我认为这是任何服务器都认为我的微信帐户状态不佳的主要原因.
I don't know if it from the WX server or the padplus
server, and I don't know how to satisfy such ClientCheckConsistency
. I believe this is the main reason that my wechat account status is considered as not good by whatever server.
结果,这就是我开箱即用的东西:
As the result, here what I get out of the box:
11:09:56 WARN Puppet constructor() watchdog.on(reset) reason: {"data":"9ee9935b-15db-442e-bfcb-5eff6396be7f","timeout":60000}
11:09:56 INFO PuppetPadplus stop()
11:09:56 INFO PuppetPadplus logout(true, logout in wechaty)
即
- padplus puppet几乎使我退出的所有情况都是由于该Puppet Constructor()看门狗超时.
- 我将
logout
作为默认行为开箱即用,并且我的node js脚本只是停止并退出,没有Alfred的下一步PuppetPadplus start()
.
- almost all cases that padplus puppet logs me out is because of this Puppet constructor() watchdog timeout.
- I got
logout
as the default behavior out of the box, and my node js script just stops and quits, no Alfred's next stepPuppetPadplus start()
.
这就是为什么我想知道是否可以在注销事件处理中重新触发登录(或重新启动).谢谢.
That is why I'm wondering if I can re-trigger the login (or restart) in logout event handling. Thx.
PPS.今天,我两次注销.这是上次的日志:
PPS. Today, I got logged out two times. Here is the log from last time:
15:46:53 VERB Unknown: <sysmsg type="ClientCheckConsistency"><ClientCheckConsistency><clientcheck><fullpathfilename>@classes.dex</fullpathfilename><fileoffset>0</fileoffset><checkbuffersize>9999999</checkbuffersize><seq>536870912</seq></clientcheck></ClientCheckConsistency></sysmsg>
. . .
15:56:51 WARN Puppet constructor() watchdog.on(reset) reason: {"data":"710...c80","timeout":60000}
15:56:51 INFO PuppetPadplus stop()
15:56:51 INFO PuppetPadplus logout(true, logout in wechaty)
推荐答案
我认为您最好在wechaty github存储库下发布问题
I think you'd better post an issue under the wechaty github repository
不,我只想克服它.所以最后我决定不使用我不知道但不太可靠的东西,而是使用我知道但非常可靠的东西:
nah, I just want to get it over with. So finally I decided not to use something that I don't know and less reliable, but something that I know and very reliable:
while :; do node index.js; sleep 1m; done
对我来说问题解决了.
这篇关于微信:是否可以在注销事件时重新触发登录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!