Open hanqdemo opened 2 years ago
To get started with Wechaty on your first time, it is recommended to use this repo by following the docs at https://wechaty.js.org/docs/getting-started/
TL;DR:
git clone git@github.com:wechaty/getting-started.git
cd getting-started
npm install
npm start
Please feel free to let me know whether the above information can solve your problem.
git clone https://github.com/wechaty/wechaty-getting-started
cd wechaty-getting-started
npm install
npm start
PS C:\Users\86180\wechaty-getting-started> npm start
> wechaty-getting-started@1.18.4 start
> cross-env NODE_OPTIONS="--no-warnings --loader=ts-node/esm" node examples/ding-dong-bot.ts
21:09:36 INFO StarterBot Starter Bot Started.
21:09:36 INFO StarterBot onScan: Waiting(2) - https://wechaty.js.org/qrcode/https%3A%2F%2Flogin.weixin.qq.com%2Fl%2FgaBo1jGhIQ%3D%3D
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█ ▄▄▄▄▄ █▀█ █▄▀▀ ▄█▀▄ █ ▄▄▄▄▄ █
█ █ █ █▀▀▀█ ▀ ██▀▀█▀█ █ █ █
█ █▄▄▄█ █▀ █▀▀▄█▀ ▄▄▄█ █▄▄▄█ █
█▄▄▄▄▄▄▄█▄▀ ▀▄█▄▀▄█ ▀ █▄▄▄▄▄▄▄█
█ ▄█▄ ▄▄▀▄▀▀▄▄▄▄▀ █ ▀ ▀▄█▄▀█
█ ▀▄█ ▄▄███▄█▀█▀▄ ▄▄▀▀▀ ▄▄▀█▀██
█ ▀▀▀ █▄▀ ▄█▄█ █▀ ▀ ▀ ▀▀▀▄▄█▀█
█▀▀▀▀▀▄▄▄▀▀█ ▄█▀▄█▄██▄▀ ▀▄▄▀██
█▀█ █▄ ▄▄▀▀▄▄▀ ▀ ▀ ▀ ▀█▀▀▀▄ █▀█
█ █ ▀▄ ▄ ▀▄▄█▀█ ▄█████▀ ██▄▀██
█▄███▄▄▄▄ █▄█▄ ▀▄▀ ▄▄▄ ▀ █
█ ▄▄▄▄▄ █▄█ ▄█ ▄ ▄█ █▄█ ▄▄▀▀█
█ █ █ █ █▄▀▀█▄▀ ▀▀▄▄▄▄▄▀ █
█ █▄▄▄█ █ ▄█▀ ▄▄ █▀█ ▄▄▄ ▄ ██
█▄▄▄▄▄▄▄█▄▄██▄█▄██▄▄▄███▄██▄███
21:09:48 INFO StarterBot onScan: Scanned(3)
uncaughtException AssertionError [ERR_ASSERTION]: 1 == 0
at Object.equal (C:\Users\86180\wechaty-getting-started\node_modules\wechat4u\src\util\global.js:53:14)
at C:\Users\86180\wechaty-getting-started\node_modules\wechat4u\src\core.js:179:16
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
code: 2,
details: 'AssertionError [ERR_ASSERTION]: 1 == 0\n' +
' at Object.equal (C:\\Users\\86180\\wechaty-getting-started\\node_modules\\wechat4u\\src\\util\\global.js:53:14)\n' +
' at C:\\Users\\86180\\wechaty-getting-started\\node_modules\\wechat4u\\src\\core.js:179:16\n' +
' at processTicksAndRejections (node:internal/process/task_queues:96:5)'
}
无法找到模块“qrcode-terminal”的声明文件。“C:/Users/86180/wechaty-getting-started/node_modules/qrcode-terminal/lib/main.js”隐式拥有 \"any\" 类型。
尝试使用 npm i --save-dev @types/qrcode-terminal
(如果存在),或者添加一个包含 declare module 'qrcode-terminal';
的新声明(.d.ts)文件",
Yes, I have the same problem with @hanqdemo
I also have this problem running on Gitpod, which just click open button and do nothing. Running on Gitpod
18:52:53 INFO StarterBot onScan: Scanned(3)
uncaughtException AssertionError [ERR_ASSERTION]: 1 == 0
at Object.equal (/Users/aoxiang/Desktop/getting-started/node_modules/wechat4u/src/util/global.js:53:14)
at /Users/aoxiang/Desktop/getting-started/node_modules/wechat4u/src/core.js:179:16
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
code: 2,
details: 'AssertionError [ERR_ASSERTION]: 1 == 0\n' +
' at Object.equal (/Users/aoxiang/Desktop/getting-started/node_modules/wechat4u/src/util/global.js:53:14)\n' +
' at /Users/aoxiang/Desktop/getting-started/node_modules/wechat4u/src/core.js:179:16\n' +
' at processTicksAndRejections (node:internal/process/task_queues:96:5)'
}
I have the same problem when i scan the qrcode
To get started with Wechaty on your first time, it is recommended to use this repo by following the docs at https://wechaty.js.org/docs/getting-started/
TL;DR:
git clone git@github.com:wechaty/getting-started.git cd getting-started npm install npm start
Please feel free to let me know whether the above information can solve your problem.
I try the ding-dong-bot under the Env as follows, but the bot logout automatically after login.
"qrcode-terminal": "^0.12.0", "wechaty": "^1.18.1", "wechaty-puppet-service": "^1.18.2" "node":v16.14.2 OS:Windows10 npm:8.5.0
set WECHATY_LOG=verbose
set WECHATY_PUPPET=wechaty-puppet-service
set WECHATY_PUPPET_SERVICE_TOKEN=puppet_paimon_04035954-23e3-4d30-924f-4ed6dc5d953f
Set WECHATY_PUPPET_SERVICE_NO_TLS_INSECURE_CLIENT = true
Set WECHATY_PUPPET_SERVICE_NO_TLS_INSECURE_SERVER = true
Set options.tls.disable = true
npm start
扫码登录之后的错误
15:16:51 VERB PuppetService onGrpcStreamEvent({type:EVENT_TYPE_LOGIN(25), payload(len:35)})
15:16:51 VERB PuppetLoginMixin login(wxid_1dzsss7f8dk622)
15:16:51 VERB PuppetService hookPayloadStore() this.on(login) contactId: "wxid_1dzsss7f8dk622"
15:16:51 VERB PayloadStore start(wxid_1dzsss7f8dk622)
15:16:51 VERB PoolifyMixin get pool() init pool
15:16:51 VERB PuppetService contactRawPayload(wxid_1dzsss7f8dk622)
15:16:51 VERB PuppetService onGrpcStreamEvent({type:EVENT_TYPE_HEARTBEAT(1), payload(len:80)})
15:16:51 VERB PuppetService onGrpcStreamEvent({type:EVENT_TYPE_READY(23), payload(len:16)})
15:16:51 VERB StateSwitch <WechatyReady> active(true) <- (false)
15:16:51 INFO StarterBot Contact<hollowhill> login
15:16:52 VERB PuppetService onGrpcStreamEvent({type:EVENT_TYPE_HEARTBEAT(1), payload(len:80)})
15:16:53 VERB PuppetService onGrpcStreamEvent({type:EVENT_TYPE_HEARTBEAT(1), payload(len:80)})
15:16:54 VERB PuppetService onGrpcStreamEvent({type:EVENT_TYPE_HEARTBEAT(1), payload(len:80)})
15:16:56 VERB PuppetService onGrpcStreamEvent({type:EVENT_TYPE_HEARTBEAT(1), payload(len:80)})
15:16:57 VERB PuppetService onGrpcStreamEvent({type:EVENT_TYPE_HEARTBEAT(1), payload(len:80)})
15:16:58 VERB PuppetService onGrpcStreamEvent({type:EVENT_TYPE_LOGOUT(26), payload(len:58)})
15:16:58 VERB PuppetService logout("logout called")
15:16:58 VERB PuppetLoginMixin logout(logout called)
15:16:58 VERB PuppetService hookPayloadStore() this.on(logout) contactId: "wxid_1dzsss7f8dk622"
15:16:58 VERB PayloadStore stop()
15:16:58 VERB StateSwitch <WechatyReady> inactive(true) <- (false)
15:16:58 INFO StarterBot Contact<hollowhill> logout
15:16:58 VERB PuppetService bridgeGrpcEventStream() eventStream.on(end)
15:17:58 WARN PuppetWatchdogAgent start() reset() reason: {"data":"onGrpcStreamEvent(EVENT_TYPE_LOGOUT)","timeoutMilliseconds":60000}
15:17:58 ERR Config ###########################
15:17:58 ERR Config Wechaty uncaughtException: Error: WatchdogAgent reset: lastFood: "{"data":"onGrpcStreamEvent(EVENT_TYPE_LOGOUT)","timeoutMilliseconds":60000}"
at Watchdog.reset (C:\Users\86180\Desktop\ding-dong-bot\node_modules\wechaty-puppet\src\agents\watchdog-agent.ts:65:33)
at Watchdog.emit (node:events:526:28)
at Watchdog.emit (node:domain:475:12)
at Timeout._onTimeout (C:\Users\86180\Desktop\ding-dong-bot\node_modules\watchdog\src\watchdog.ts:115:12)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7) uncaughtException
15:17:58 ERR Config ###########################
16:04:39 INFO StarterBot onScan: Scanned(3) uncaughtException AssertionError [ERR_ASSERTION]: 1 == 0 at Object.equal (E:\github\wechaty\getting-started\node_modules\wechat4u\src\util\global.js:53:14) at E:\github\wechaty\getting-started\node_modules\wechat4u\src\core.js:179:16 at processTicksAndRejections (node:internal/process/task_queues:96:5) { code: 2, details: 'AssertionError [ERR_ASSERTION]: 1 == 0\n' + ' at Object.equal (E:\github\wechaty\getting-started\node_modules\wechat4u\src\util\global.js:53:14)\n' + ' at E:\github\wechaty\getting-started\node_modules\wechat4u\src\core.js:179:16\n' + ' at processTicksAndRejections (node:internal/process/task_queues:96:5)' }
I'm new here and I got the same exception
█ █ █ █▀▀▀ █▀▀ ▀▄█▀ ▄ ▀▄▄ █
█ █▄▄▄█ █ ▄ █ ▀▄█▀█ ▄ ██▄▀▀▄▀▄█
█▄▄▄▄▄▄▄█▄▄█▄███▄███▄▄▄██▄██▄██
uncaughtException AssertionError [ERR_ASSERTION]: 1 == 0
at Object.equal (/Users/helloint/workspace/getting-started/node_modules/wechat4u/src/util/global.js:53:14)
at /Users/helloint/workspace/getting-started/node_modules/wechat4u/src/core.js:179:16
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
code: 2,
details: 'AssertionError [ERR_ASSERTION]: 1 == 0\n' +
' at Object.equal (/Users/helloint/workspace/getting-started/node_modules/wechat4u/src/util/global.js:53:14)\n' +
' at /Users/helloint/workspace/getting-started/node_modules/wechat4u/src/core.js:179:16\n' +
' at processTicksAndRejections (node:internal/process/task_queues:96:5)'
}
I believe this is because of the web protocol issue. I'm using a new wechat account, for security concern, and this account's web protocol is disabled. Looks like wechat disabled web protocol for all the new accounts. I tried the old wechart account in the same way and it works fine.
Env:
reproduce:
(Create a new file ding-dong-bot.ts. Write the code)
Err: