abhinavdahiya / go-messenger-bot

Golang bindings for the Messenger Bot API
https://godoc.org/github.com/abhinavdahiya/go-messenger-bot
MIT License
52 stars 10 forks source link

add IsEcho and update IsMessage() to exclude echoes #8

Closed alsuren closed 8 months ago

alsuren commented 7 years ago

If you subscribe your bot to message_echoes, then you need to treat echoes differently from incoming, or you risk causing infinite loops.

I think that tweaking IsMessage() is the sensible thing to do, but you might disagree. I have only tried it out for about 5 seconds in my little test app, to verify that it solves my infinite loop. If you only want the IsEcho part of the patch then that's fine too.