mullwar / telebot

The easy way to write Telegram bots in Node.js
https://www.npmjs.com/package/telebot
MIT License
1.48k stars 270 forks source link

sendMessage event firing twice #160

Open bGussi opened 5 years ago

bGussi commented 5 years ago

https://github.com/mullwar/telebot/blob/3b9bd549170361aa1b12016e8b3e4c38aa15bd60/lib/telebot.js#L549

Hi, tried to listen to sendMessage bot event and noticed callback fired twice for me, after some time looking into the code, found a solution that works for me but didn't completely tested it: this.event([id], arguments);. The issue is that apparently 'AddMethods' method calls event() method using 2 similar types(in my case ['sendMessage', 'sendMessage'])

Srry for possible bad english