Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contact的alias方法的问题 #235

Closed
J1angX1n opened this issue Dec 3, 2021 · 6 comments
Closed

Contact的alias方法的问题 #235

J1angX1n opened this issue Dec 3, 2021 · 6 comments

Comments

@J1angX1n
Copy link

J1angX1n commented Dec 3, 2021

我参考官方的api想测试我的微信机器人,但是每次当我想用alias方法去尝试修改好友备注的时候控制台就会疯狂地循环打印信息,是我有什么地方调用出错了吗
我的代码:

async (data:any) => {
              if(data){
                  if(msg.talker()!=undefined){
                      const contact:(Contact|undefined) = msg.talker(); 
                      if(contact){
                        try {
                          const userKey:string = 'user:'+msg.text().split(' ')[1];
                          await contact.alias(userKey);
                        } catch (e) {
                          console.log(`failed to change ${contact.name()} alias!`)
                        }
                      }
                  }
              }
            }

循环打印的信息:

15:21:35 VERB PuppetCacheMixin __dirtyPayloadAwait(Contact<2>, @d2311b84195c9e7a3085c02304bc4a3e376a5f925cf2f27a5912597389df943b)
15:21:35 VERB PuppetCacheMixin dirtyPayload(Contact<2>, @d2311b84195c9e7a3085c02304bc4a3e376a5f925cf2f27a5912597389df943b)
15:21:35 VERB PuppetCacheMixin onDirty(Contact<2>, @d2311b84195c9e7a3085c02304bc4a3e376a5f925cf2f27a5912597389df943b)
15:21:35 VERB PuppetContactMixin contactPayloadDirty(@d2311b84195c9e7a3085c02304bc4a3e376a5f925cf2f27a5912597389df943b)

我使用的puppet是默认网页API的puppeteer,平台是macos本机运行
我翻阅了一些以前的issue,找到过一些类似的内容,但是还是有疑惑

@huan
Copy link
Member

huan commented Dec 3, 2021

What's the out put of the following command?

npm ls wechaty
npm ls wechaty-puppet
npm ls wechaty-puppet-wechat

@J1angX1n
Copy link
Author

J1angX1n commented Dec 4, 2021

What's the out put of the following command?

npm ls wechaty
npm ls wechaty-puppet
npm ls wechaty-puppet-wechat

out put of "npm ls wechaty":

wechaty-getting-started@1.10.1 /Users/mac/jx project/getting-started
└── wechaty@1.10.4

out put of "npm ls wechaty-puppet"

wechaty-getting-started@1.10.1 /Users/mac/jx project/getting-started
├─┬ wechaty-puppet-mock@1.10.2
│ └── wechaty-puppet@1.10.2
├─┬ wechaty-puppet-oicq@1.10.2
│ └── wechaty-puppet@1.10.2 deduped
├─┬ wechaty-puppet-wechat@1.10.4
│ └── wechaty-puppet@1.10.2 deduped
├─┬ wechaty-puppet-wechat4u@1.10.2
│ └── wechaty-puppet@1.10.2 deduped
├─┬ wechaty-puppet-whatsapp@1.10.4
│ └── wechaty-puppet@1.10.2 deduped
├─┬ wechaty-puppet-xp@1.10.2
│ └── wechaty-puppet@1.10.2 deduped
└─┬ wechaty@1.10.4
  ├─┬ wechaty-puppet-service@1.10.2
  │ ├── wechaty-puppet@1.10.2 deduped
  │ └─┬ wechaty-redux@1.10.2
  │   └── wechaty-puppet@1.10.2 deduped
  └── wechaty-puppet@1.10.2 deduped

out put of "npm ls wechaty-puppet-wechat"

wechaty-getting-started@1.10.1 /Users/mac/jx project/getting-started
└── wechaty-puppet-wechat@1.10.4

@huan
Copy link
Member

huan commented Dec 4, 2021

Thank you very much for your information.

Could you please try the @next version to see if the problems still exist?

Update your dependencies by running:

npm i wechaty@next wechaty-puppet-wechat@next

@huan huan added the bug label Dec 4, 2021
@J1angX1n
Copy link
Author

J1angX1n commented Dec 4, 2021

似乎还是不行,不知道是不是我的mac环境的问题,我一会把它搬到另一台linux电脑上试试

@huan huan added duplicate and removed bug labels Dec 4, 2021
@huan
Copy link
Member

huan commented Dec 4, 2021

@huan huan closed this as completed Dec 4, 2021
@J1angX1n
Copy link
Author

J1angX1n commented Dec 4, 2021

我的情况和这位兄弟稍有不同,我这里也会不断地刷log但是似乎程序还是可以运行的,并没有卡死,我的log信息如下,log信息大致和他的差不多。
我刚才测试了一下只有在调用alias去修改备注的时候会出错,如果只是获取备注是没问题的,希望log信息对你有帮助
截屏2021-12-04 下午2.58.47.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants