J
J
jenya77712018-05-30 15:53:15
Node.js
jenya7771, 2018-05-30 15:53:15

How to remove a button in a Telegram bot if the user has not clicked on it?

Hello, I ask the user a question, but he may not answer it by pressing the skip button, and if he still answered the question, then the button remains. How can I remove it when sending the next message?
This is how I send a message with a question:

bot.sendMessage(id, `Введите телефон:`,  {
            reply_markup: {
              resize_keyboard: true,
              one_time_keyboard: true,
              keyboard: 
            }
          })

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
abonu, 2018-05-30
@abonu

In response to a sent message, its message_id comes. Save it and when the next message comes send a blank keyboard for that message_id

R
Restwl, 2018-05-31
@Restwl

To remove a custom keyboard, use the ReplyKeyboardRemove special type. It must be sent along with the response message. Read more: https://core.telegram.org/bots/api#replykeyboardremove

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question