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

m.say() repeat many many times #1216

Closed
Ramonywangziyao opened this issue May 18, 2018 · 6 comments
Closed

m.say() repeat many many times #1216

Ramonywangziyao opened this issue May 18, 2018 · 6 comments

Comments

@Ramonywangziyao
Copy link

when i call m.say(), it kept sending out lots of same msg blows up the receiver. what is wrong?
thanks

@ken-talkingsource
Copy link

ken-talkingsource commented May 18, 2018

如果你寫一個類似回音的功能,要在啟動後紀錄自己的 id,並在訊息回覆前過濾掉。
If you wrote some function like "echo", you have to record user.id after login and filter this out when you reply message.

@huan
Copy link
Member

huan commented May 18, 2018

Need More Information

Sorry, you did not follow the ISSUE Template, and there's not enough information about your problem.

In order to help us to find the problem out, you should provide all the detail information about the issue. Please make sure you are following the ISSUE Template, answer all the question, and the more important: provide the steps to reproduce the problem.

@Ramonywangziyao
Copy link
Author

in .on('message', async m => {
m.say('hi')
})

when is is called after receiving a message, it sends out tons of 'hi' to the sender, only stop if i shut it down or the server stopped responding.

i used npm for installing wechaty, tried both the newest version as well as @0.14

thanks!

@huan
Copy link
Member

huan commented May 19, 2018

Yes it's a dead loop.

You need to use m.self() to skip the message form yourself.

@suntong
Copy link
Contributor

suntong commented May 22, 2018

your account didn't get blocked for that @Ramonywangziyao? Amazing...

@huan
Copy link
Member

huan commented Jul 6, 2018

Close this issue because it's answered, and inactivity for 60 days.

@huan huan closed this as completed Jul 6, 2018
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

4 participants