wechaty / puppet-wechat4u

Wechat4u Puppet for Wechaty
https://www.npmjs.com/package/wechaty-puppet-wechat4u
Apache License 2.0
101 stars 34 forks source link

Different error with wechaty-puppet-wechat and wechaty-puppet-wechat4u #36

Open NoverNobida opened 2 years ago

NoverNobida commented 2 years ago

I can login web wechat. When I used WECHATY_PUPPET=wechaty-puppet-wechat, the bot replied Scanned. Please confirm on your phone. but nothing else , and the log showed that the login failed.

matrix-wechaty      | 13:53:57 VERB AppserviceManager sendMessage(Scanned. Please confirm on your phone., !vulonkuhMrHqTrGsOW:***.***.com)
matrix-wechaty      | 13:53:58 SILL PuppetWeChatEvent onLog(checkScan() code:201 url:https://login.weixin.qq.com/qrcode/AfVlmqBVmg== scanCode:201)
matrix-wechaty      | 13:53:59 SILL PuppetWeChatEvent onLog(checkScan() code:201 url:https://login.weixin.qq.com/qrcode/AfVlmqBVmg== scanCode:201)
matrix-wechaty      | 13:53:59 SILL PuppetWeChatEvent onUnload()
matrix-wechaty      | 13:53:59 SILL PuppetWeChatEvent onLog(event unload)
matrix-wechaty      | 13:53:59 VERB PuppetWeChatBridge onLoad() page.url=https://wx2.qq.com/cgi-bin/mmwebwx-bin/webwxnewloginpage?ticket=Axl5HGmRduRc0TIbGf8QxS8G@qrticket_0&uuid=AfVlmqBVmg==&lang=en_US&scan=1641822836
matrix-wechaty      | 13:53:59 SILL StateSwitch <PuppetWeChatBridge> off() is false
matrix-wechaty      | 13:54:00 VERB PuppetWeChatBridge readyAngular()
matrix-wechaty      | 13:54:30 VERB PuppetWeChatBridge readyAngular() exception: TimeoutError: waiting for function failed: timeout 30000ms exceeded
matrix-wechaty      | 13:54:30 SILL PuppetWeChatBridge evaluate()
matrix-wechaty      | 13:54:30 VERB PuppetWeChatBridge testBlockedMessage(<pre style="word-wrap: break-word; white-space: pr)
matrix-wechaty      | 13:54:30 VERB PuppetWeChatBridge preHtmlToXml()
matrix-wechaty      | 13:54:30 INFO PuppetWeChatBridge 
matrix-wechaty      | 
matrix-wechaty      |         Please see: Account Login Issue <https://github.com/wechaty/wechaty/issues/872>
matrix-wechaty      | 
matrix-wechaty      |         
matrix-wechaty      | 13:54:30 WARN PuppetWeChatBridge testBlockedMessage() error.ret=1203
matrix-wechaty      | 13:54:30 ERR PuppetWeChatBridge onLoad() exception: Error: 登入失敗。
matrix-wechaty      | 13:54:30 ERR Config ###########################
matrix-wechaty      | 13:54:30 ERR Config unhandledRejection: Error: 登入失敗。
matrix-wechaty      |     at PuppetWeChat.<anonymous> (/matrix-appservice-wechaty/node_modules/wechaty/dist/src/wechaty.js:272:44)
matrix-wechaty      |     at PuppetWeChat.emit (events.js:376:20)
matrix-wechaty      |     at PuppetWeChat.emit (domain.js:470:12)
matrix-wechaty      |     at Bridge.<anonymous> (/wechaty/node_modules/wechaty-puppet-wechat/dist/src/puppet-wechat.js:202:45)
matrix-wechaty      |     at Bridge.emit (events.js:376:20)
matrix-wechaty      |     at Bridge.emit (domain.js:470:12)
matrix-wechaty      |     at Bridge.onLoad (/wechaty/node_modules/wechaty-puppet-wechat/dist/src/bridge.js:156:18)
matrix-wechaty      |     at processTicksAndRejections (internal/process/task_queues.js:95:5) [object Promise]

When I use WECHATY_PUPPET=wechaty-puppet-wechat4u, the bot replies that the login is successful, but the user name cannot be displayed You are now logged in to Wechat. Your user name is:, and when a message is received, although the message can be seen in the log, no new session is generated.

matrix-wechaty      | 14:18:54 SILL Contact constructor(@0496fcc3cae52a36f37bf8852b94cd5a1f85dff3f36c2bdfbcebef2b3f74eb9f)
matrix-wechaty      | 14:18:54 SILL Contact ready() @ Puppet#0<PuppetWechat4u>(@root:***.***.com) with id="@0496fcc3cae52a36f37bf8852b94cd5a1f85dff3f36c2bdfbcebef2b3f74eb9f"
matrix-wechaty      | 14:18:54 VERB WechatyManager onMessage("Message#Text[🗣Contact<nov-919>]   test") from "@32d6c74db3a2cc6f4ed67f50847616544c5a7c0b08b44cd328a05418bc7b3a70" to "@0496fcc3cae52a36f37bf8852b94cd5a1f85dff3f36c2bdfbcebef2b3f74eb9f" with age "0" (timestamp: "1641824334")
matrix-wechaty      | 14:18:54 VERB Puppet selfId()
matrix-wechaty      | 14:18:54 VERB WechatyManager processContactMessage(Message#Text[🗣Contact<nov-919>]        test)
matrix-wechaty      | 14:18:54 VERB MiddleManager directMessageToMatrixConsumer("test", "Contact<nov-919>")
matrix-wechaty      | 14:18:54 VERB MiddleManager matrixRoom(Contact<nov-919>)
matrix-wechaty      | 14:18:54 VERB WechatyManager consumerId(Wechaty#cky8rslzk000009paglb37sf1<>(@root:***.***.com))
matrix-wechaty      | 14:18:54 VERB MiddleManager matrixUser(Contact<nov-919>)
matrix-wechaty      | 14:18:54 VERB WechatyManager consumerId(Wechaty#cky8rslzk000009paglb37sf1<>(@root:***.***.com))
matrix-wechaty      | 14:18:54 VERB AppserviceManager storeQuery(wechatyBridgeUser, "{"consumerId":"@root:***.***.com","wechatyUserId":"@32d6c74db3a2cc6f4ed67f50847616544c5a7c0b08b44cd328a05418bc7b3a70"}")
matrix-wechaty      | 14:18:54 VERB MiddleManager generateMatrixUser(@32d6c74db3a2cc6f4ed67f50847616544c5a7c0b08b44cd328a05418bc7b3a70, "{"consumerId":"@root:***.***.com","wechatyUserId":"@32d6c74db3a2cc6f4ed67f50847616544c5a7c0b08b44cd328a05418bc7b3a70"}")
matrix-wechaty      | 14:18:54 VERB Contact avatar()
matrix-wechaty      | 14:18:54 VERB PuppetWechat4u contactAvatar(@32d6c74db3a2cc6f4ed67f50847616544c5a7c0b08b44cd328a05418bc7b3a70)
matrix-wechaty      | 14:18:54 VERB PuppetWechat4u contactRawPayload(@32d6c74db3a2cc6f4ed67f50847616544c5a7c0b08b44cd328a05418bc7b3a70) with contacts.length=330
matrix-wechaty      | 14:18:54 VERB PuppetWechat4u contactRawPayload(@32d6c74db3a2cc6f4ed67f50847616544c5a7c0b08b44cd328a05418bc7b3a70) retry() attempt=1
matrix-wechaty      | 14:18:55 ERR Config ###########################
matrix-wechaty      | 14:18:55 ERR Config unhandledRejection: TypeError: stream.on is not a function
matrix-wechaty      |     at /wechaty/node_modules/file-box/dist/src/file-box.js:470:20
matrix-wechaty      |     at processTicksAndRejections (internal/process/task_queues.js:95:5) [object Promise]
matrix-wechaty      | 14:18:55 ERR Config ###########################
matrix-wechaty      | 14:18:55 ERR Config process.on(unhandledRejection) promise.catch(stream.on is not a function)
matrix-wechaty      | Config TypeError: stream.on is not a function
matrix-wechaty      |     at /wechaty/node_modules/file-box/dist/src/file-box.js:470:20
matrix-wechaty      |     at processTicksAndRejections (internal/process/task_queues.js:95:5)
matrix-wechaty      | (node:9) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 1)
matrix-wechaty      | (Use `node --trace-warnings ...` to show where the warning was created)
matrix-wechaty      | 14:18:55 WARN matrix-appservice-wechaty process.on(warning)
matrix-wechaty      | PromiseRejectionHandledWarning
matrix-wechaty      | Promise rejection was handled asynchronously (rejection id: 1)
matrix-wechaty      | PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 1)
matrix-wechaty      |     at handledRejection (internal/process/promises.js:140:23)
matrix-wechaty      |     at promiseRejectHandler (internal/process/promises.js:102:7)
matrix-wechaty      |     at Promise.then (<anonymous>)
matrix-wechaty      |     at Promise.catch (<anonymous>)
matrix-wechaty      |     at process.<anonymous> (/matrix-appservice-wechaty/node_modules/wechaty/dist/src/config.js:81:22)
matrix-wechaty      |     at process.emit (events.js:376:20)
matrix-wechaty      |     at process.emit (domain.js:470:12)
matrix-wechaty      |     at processPromiseRejections (internal/process/promises.js:245:33)
matrix-wechaty      |     at processTicksAndRejections (internal/process/task_queues.js:96:32)
huan commented 2 years ago

wechaty-puppet-wechat is failing because UOS has been disabled by Tencent recently. See:

wechaty-puppet-wechat4u works before if your WeChat account can log in the web wechat, however, if you have any issue with it, the best way is to read the source code and try to figure it out by yourself because there might have bugs in it.