当我按下另一个按钮时,我想更改我的 InlineKeyboard 按钮,但我不断收到此错误。
TypeError: Cannot create property 'reply_markup' on number '750548132'
2019-04-13T06:42:14.374318+00:00 app[web.1]: at TelegramBot.editMessageReplyMarkup (/app/node_modules/node-telegram-bot-api/src/telegram.js:1201:23)
2019-04-13T06:42:14.374320+00:00 app[web.1]: at TelegramBot.bot.on (/app/index.js:371:11)
2019-04-13T06:42:14.374321+00:00 app[web.1]: at TelegramBot.emit (/app/node_modules/eventemitter3/index.js:181:35)
2019-04-13T06:42:14.374323+00:00 app[web.1]: at TelegramBot.processUpdate (/app/node_modules/node-telegram-bot-api/src/telegram.js:657:12)
2019-04-13T06:42:14.374324+00:00 app[web.1]: at TelegramBotWebHook._parseBody (/app/node_modules/node-telegram-bot-api/src/telegramWebHook.js:121:21)
我的代码:
const messageID = callbackQuery.message.chat.id;
const callBackData = callbackQuery.data;
if (callBackData.substring(0,7) == 'intent_') {
keyboard = {
reply_markup: {
inline_keyboard: [[
{
text: 'Menu 1',
callback_data: 'socialMediaConnect'
},{
text: 'Menu 2',
callback_data: 'music'
}
]]
}
}
bot.editMessageReplyMarkup(messageID, callbackQuery.message.from.id, callbackQuery.inline_message_id, keyboard)
}