node-telegram-bot-api icon indicating copy to clipboard operation
node-telegram-bot-api copied to clipboard

EditMessageReplyMarkup 400 Bad Request: object expected as reply markup

Open heinminthant opened this issue 6 years ago • 3 comments

When I tried to edit the inline keyboard buttons: This error always appears: Unhandled rejection Error: ETELEGRAM: 400 Bad Request: object expected as reply markup

My Code:

bot.editMessageReplyMarkup(messageID,{
        reply_markup: {
        inline_keyboard: [[
          {
            text: 'Set Credentials',
            callback_data: 'GG',
            url : 'https://override-webserver.herokuapp.com/viber?num='
          },{
            text: 'Intent Lists',
            callback_data: 'intentList'
          }
        ]]
      }
      })

heinminthant avatar Apr 13 '19 07:04 heinminthant

because the object you need to pass, must be the reply_markup content, as stated by the official bot api

bot.editMessageReplyMarkup(messageID, {
    inline_keyboard: [[ ... ]]
});

alexandercerutti avatar Apr 13 '19 17:04 alexandercerutti

Still getting the same error until I got rid of messageID

bot.editMessageReplyMarkup( { inline_keyboard: [[ ... ]] });

worked for me, changing the last inline keyboard

farkhad99 avatar Jun 13 '19 19:06 farkhad99

I having the same problem, although I get rid of messageID. Capture

MSCSllBenz avatar Aug 24 '19 16:08 MSCSllBenz