node-telegram-bot-api
node-telegram-bot-api copied to clipboard
remove_keyboard doesn't work in sendPhoto
Bug Report
I have read:
I am using the latest version of the library.
Expected Behavior
sendPhoto(msg.from.id, 'img.png', { reply_markup: { inline_keyboard: [
[{ text: 'btn', callback_data: 'data' }]],
remove_keyboard: true
}
}
);
It should remove the keyboard created in a previous message.
Actual Behavior
The previous created keyboard is not removed, it is necessary to send an additional text message containing the option to remove it.
Steps to reproduce the Behavior
- Create a ReplyKeyboardMarkup
- Try removing it from sendPhoto
The problem is more that you can't do two things at the same time (Telegram Bot API backend limits). If in your message send the remove_keyboard: true, you can't send a inline_keyboard for your photo. Telegram ignore the remove_keyboard in your case.
bot.sendMessage(msg.from.id, "Hello", { reply_markup: {
keyboard: [["Yes"], ["No"]],
resize_keyboard: true,
} })
bot.sendPhoto(msg.from.id, "https://raw.githubusercontent.com/yagop/node-telegram-bot-api/53b5565e8a87933d096de61af22e39711cbc8273/test/data/chat_photo.png", {
reply_markup: {
remove_keyboard: true
}
}