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 FindAll() API does not work. #299

Open
wenzai007 opened this issue Oct 3, 2023 · 0 comments
Open

Contact FindAll() API does not work. #299

wenzai007 opened this issue Oct 3, 2023 · 0 comments

Comments

@wenzai007
Copy link

wenzai007 commented Oct 3, 2023

const contactList = await bot.Contact.findAll()

while I am using this API in the demo code, I found it throws below exception. Is it that you did not implement the FindAll() API for PuppetWechat4u? Or it has some bug here? It worked well for pad local protocol as I remembered previously.

"uncaughtException GError [TypeError]: this.wechat4u.contacts.filter is not a function"

23:00:47 VERB PuppetContactMixin contactSearch(query={"name":"Peter"}, )
23:00:47 VERB PuppetWechat4u contactList()
23:00:47 SILL PuppetLoginMixin get currentUserId()
23:00:47 SILL PuppetLoginMixin get currentUserId()
23:00:47 INFO the type of the from person is 1
23:00:47 SILL Contact find({"name":"Peter"})
23:00:47 VERB Contact findAll({"name":"Peter"})
23:00:47 VERB PuppetContactMixin contactSearch(query={"name":"Peter"}, )
23:00:47 VERB PuppetWechat4u contactList()
23:00:47 SILL PuppetLoginMixin get currentUserId()
uncaughtException GError [TypeError]: this.wechat4u.contacts.filter is not a function
at PuppetWechat4u.contactList (file:///rootfolder/getting-started/node_modules/wechaty-puppet-wechat4u/src/puppet-wechat4u.ts:411:8)
at PuppetWechat4u.contactSearch (file:///rootfolder/getting-started/node_modules/wechaty-puppet/src/mixins/contact-mixin.ts:115:35)
at Function.findAll (file:///rootfolder/getting-started/node_modules/wechaty/src/user-modules/contact.ts:176:65)
at Function.find (file:///rootfolder/getting-started/node_modules/wechaty/src/user-modules/contact.ts:123:36)
at WechatyImpl.onMessage (file:///rootfolder/getting-started/examples/ding-dong-bot.ts:95:43)
at WechatyImpl.emit (node:events:527:28)
at WechatyImpl.emit (node:domain:475:12)
at WechatyImpl.emit (file:///rootfolder/getting-started/node_modules/wechaty/src/wechaty-mixins/gerror-mixin.ts:44:22)
at PuppetWechat4u. (file:///rootfolder/getting-started/node_modules/wechaty/src/wechaty-mixins/puppet-mixin.ts:281:22)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
code: 2,
details: 'TypeError: this.wechat4u.contacts.filter is not a function\n' +
' at PuppetWechat4u.contactList (file:///rootfolder/getting-started/node_modules/wechaty-puppet-wechat4u/src/puppet-wechat4u.ts:411:8)\n' +
' at PuppetWechat4u.contactSearch (file:///rootfolder/getting-started/node_modules/wechaty-puppet/src/mixins/contact-mixin.ts:115:35)\n' +
' at Function.findAll (file:///rootfolder/getting-started/node_modules/wechaty/src/user-modules/contact.ts:176:65)\n' +
' at Function.find (file:///rootfolder/getting-started/node_modules/wechaty/src/user-modules/contact.ts:123:36)\n' +
' at WechatyImpl.onMessage (file:///rootfolder/getting-started/examples/ding-dong-bot.ts:95:43)\n' +
' at WechatyImpl.emit (node:events:527:28)\n' +
' at WechatyImpl.emit (node:domain:475:12)\n' +
' at WechatyImpl.emit (file:///rootfolder/getting-started/node_modules/wechaty/src/wechaty-mixins/gerror-mixin.ts:44:22)\n' +
' at PuppetWechat4u. (file:///rootfolder/getting-started/node_modules/wechaty/src/wechaty-mixins/puppet-mixin.ts:281:22)\n' +
' at processTicksAndRejections (node:internal/process/task_queues:96:5)'
}
uncaughtException GError [TypeError]: this.wechat4u.contacts.filter is not a function
at PuppetWechat4u.contactList (file:///rootfolder/getting-started/node_modules/wechaty-puppet-wechat4u/src/puppet-wechat4u.ts:411:8)
at PuppetWechat4u.contactSearch (file:///rootfolder/getting-started/node_modules/wechaty-puppet/src/mixins/contact-mixin.ts:115:35)
at Function.findAll (file:///rootfolder/getting-started/node_modules/wechaty/src/user-modules/contact.ts:176:65)
at Function.find (file:///rootfolder/getting-started/node_modules/wechaty/src/user-modules/contact.ts:123:36)
at WechatyImpl.onMessage (file:///rootfolder/getting-started/examples/ding-dong-bot.ts:95:43)
at WechatyImpl.emit (node:events:527:28)
at WechatyImpl.emit (node:domain:475:12)
at WechatyImpl.emit (file:///rootfolder/getting-started/node_modules/wechaty/src/wechaty-mixins/gerror-mixin.ts:44:22)
at PuppetWechat4u. (file:///rootfolder/getting-started/node_modules/wechaty/src/wechaty-mixins/puppet-mixin.ts:281:22)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
code: 2,
details: 'TypeError: this.wechat4u.contacts.filter is not a function\n' +
' at PuppetWechat4u.contactList (file:///rootfolder/getting-started/node_modules/wechaty-puppet-wechat4u/src/puppet-wechat4u.ts:411:8)\n' +
' at PuppetWechat4u.contactSearch (file:///rootfolder/getting-started/node_modules/wechaty-puppet/src/mixins/contact-mixin.ts:115:35)\n' +
' at Function.findAll (file:///rootfolder/getting-started/node_modules/wechaty/src/user-modules/contact.ts:176:65)\n' +
' at Function.find (file:///rootfolder/getting-started/node_modules/wechaty/src/user-modules/contact.ts:123:36)\n' +
' at WechatyImpl.onMessage (file:///rootfolder/getting-started/examples/ding-dong-bot.ts:95:43)\n' +
' at WechatyImpl.emit (node:events:527:28)\n' +
' at WechatyImpl.emit (node:domain:475:12)\n' +
' at WechatyImpl.emit (file:///rootfolder/getting-started/node_modules/wechaty/src/wechaty-mixins/gerror-mixin.ts:44:22)\n' +
' at PuppetWechat4u. (file:///rootfolder/getting-started/node_modules/wechaty/src/wechaty-mixins/puppet-mixin.ts:281:22)\n' +
' at processTicksAndRejections (node:internal/process/task_queues:96:5)'
}
uncaughtException GError [TypeError]: this.wechat4u.contacts.filter is not a function
at PuppetWechat4u.contactList (file:///rootfolder/getting-started/node_modules/wechaty-puppet-wechat4u/src/puppet-wechat4u.ts:411:8)
at PuppetWechat4u.contactSearch (file:///rootfolder/getting-started/node_modules/wechaty-puppet/src/mixins/contact-mixin.ts:115:35)
at Function.findAll (file:///rootfolder/getting-started/node_modules/wechaty/src/user-modules/contact.ts:176:65)
at Function.find (file:///rootfolder/getting-started/node_modules/wechaty/src/user-modules/contact.ts:123:36)
at WechatyImpl.onMessage (file:///rootfolder/getting-started/examples/ding-dong-bot.ts:95:43)
at WechatyImpl.emit (node:events:527:28)
at WechatyImpl.emit (node:domain:475:12)
at WechatyImpl.emit (file:///rootfolder/getting-started/node_modules/wechaty/src/wechaty-mixins/gerror-mixin.ts:44:22)
at PuppetWechat4u. (file:///rootfolder/getting-started/node_modules/wechaty/src/wechaty-mixins/puppet-mixin.ts:281:22)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
code: 2,
details: 'TypeError: this.wechat4u.contacts.filter is not a function\n' +
' at PuppetWechat4u.contactList (file:///rootfolder/getting-started/node_modules/wechaty-puppet-wechat4u/src/puppet-wechat4u.ts:411:8)\n' +
' at PuppetWechat4u.contactSearch (file:///rootfolder/getting-started/node_modules/wechaty-puppet/src/mixins/contact-mixin.ts:115:35)\n' +
' at Function.findAll (file:///rootfolder/getting-started/node_modules/wechaty/src/user-modules/contact.ts:176:65)\n' +
' at Function.find (file:///rootfolder/getting-started/node_modules/wechaty/src/user-modules/contact.ts:123:36)\n' +
' at WechatyImpl.onMessage (file:///rootfolder/getting-started/examples/ding-dong-bot.ts:95:43)\n' +
' at WechatyImpl.emit (node:events:527:28)\n' +
' at WechatyImpl.emit (node:domain:475:12)\n' +
' at WechatyImpl.emit (file:///rootfolder/getting-started/node_modules/wechaty/src/wechaty-mixins/gerror-mixin.ts:44:22)\n' +
' at PuppetWechat4u. (file:///rootfolder/getting-started/node_modules/wechaty/src/wechaty-mixins/puppet-mixin.ts:281:22)\n' +
' at processTicksAndRejections (node:internal/process/task_queues:96:5)'
}
23:00:47 SILL PuppetWechat4u initHookEvents() wechat4u.on(contacts-updated) new/total contacts.length=101/105
23:00:49 SILL PuppetWechat4u initHookEvents() wechat4u.on(contacts-updated) new/total contacts.length=43/107
23:00:49 SILL PuppetWechat4u initHookEvents() wechat4u.on(contacts-updated) new/total contacts.length=43/107
23:00:49 SILL PuppetWechat4u initHookEvents() wechat4u.on(contacts-updated) new/total contacts.length=43/107
23:00:49 SILL PuppetWechat4u initHookEvents() wechat4u.on(contacts-updated) new/total contacts.length=43/107

@wenzai007 wenzai007 changed the title FindAll() API does not work. Contact FindAll() API does not work. Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant