depoio / node-telegram-bot

Client wrapper for Telegram Bot API (Under heavy development)
MIT License
136 stars 30 forks source link

bug: replay inline keyboard with callback has crash #84

Open A1Gard opened 7 years ago

A1Gard commented 7 years ago

when we send lnlinekeyboards to user after click on those keyboards the bot crashed. I fixed this bug for myself by this solution add some code above of this line:

if (msg.message.text &&msg.message.text.charAt(0)=== '/') {

my fixing code:

if (msg.message == undefined && msg.callback_query !== undefined) {
       msg.message = msg.callback_query.message;
       msg.message.data = msg.callback_query.data;
}

I can commit & pull request for your repo

Thanks 4 dev this bot Kind regards #