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

Comments

Projects
None yet
4 participants
@Ramonywangziyao
Copy link

Ramonywangziyao commented May 18, 2018

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

@ken-talkingsource

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link

Ramonywangziyao commented May 18, 2018

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor

suntong commented May 22, 2018

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

@huan

This comment has been minimized.

Copy link
Member

huan commented Jul 6, 2018

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

@huan huan closed this Jul 6, 2018

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