3
votes

In Telegram bot you can send a message with the reply keyboard using the sendMessage method.

The keyboard is getting displayed instead of normal qwerty one.

We can remove the displayed keyboard by sending another message and by passing ReplyKeyboardRemove object with it. However, this requires some extraneous message to be sent.

Is it possible to remove the keyboard without actually sending any real message?

I'm aware of one_time_keyboard option, but it will only hide the keyboard without removing it.

2

2 Answers

5
votes

You could edit the message using editMessageText or editMessageReplyMarkup and simply not pass a reply_markup to make it disappear.

0
votes

I was using node-telegram-bot-api and I was able to do it using remove_keyboard.

There is a way to do this in all the languages.

return bot.sendMessage(chatId, data, {
    parse_mode: 'HTML',
    reply_markup: { remove_keyboard: true },
});