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

Error: static puppet not found #1161

Closed
liuxing opened this issue Apr 23, 2018 · 6 comments
Closed

Error: static puppet not found #1161

liuxing opened this issue Apr 23, 2018 · 6 comments

Comments

@liuxing
Copy link

liuxing commented Apr 23, 2018

环境:

node 8.9.3
npm 5.8.0
wechaty 0.15.11

我使用如下代码的时候报错 Error: static puppet not found

    if(/room/.test(content)){
        let keyroom = await Room.find({topic: 'test'})
        if(keyroom){
            await keyroom.add(contact)
            await keyroom.say('welcome!', contact)
        }
    }
@huan
Copy link
Member

huan commented Apr 23, 2018

v0.15 is in heavy development with many BREAKING CHANGES.

Please stick on v0.14 and do not upgrade until the v0.16 had been published(with the Release Notes you can find out how to migrate from v0.14 to v0.16).

If you want to know more about v0.15 as a developer, please read the source code, and also here's a blog had wrote some of the BREAKING CHANGES: https://blog.chatie.io/blessed-twins-bot/

At last, your code have to be rewriten in order to work under v0.15 like this:

-         let keyroom = await Room.find({topic: 'test'})
+        let keyroom = await bot.Room.find({topic: 'test'})

@huan huan added the question label Apr 23, 2018
@huan
Copy link
Member

huan commented Apr 24, 2018

I hope your issue was solved and your code is well.

Please also see #518 (comment), which might prevent the BREAKING CHANGES, which means you can still use the Room.find() if you are using Wechaty.instance().

@liuxing
Copy link
Author

liuxing commented Apr 25, 2018

Thanks.This is so wonderful!

@huan huan added this to the New Puppet for Wechat4U milestone Apr 26, 2018
@huan
Copy link
Member

huan commented Apr 30, 2018

Fixed after v0.15.26

@huan huan closed this as completed Apr 30, 2018
@huan
Copy link
Member

huan commented May 11, 2018

See Also: #1200

@huan
Copy link
Member

huan commented Jul 3, 2018

Merge to #1217

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

3 participants