1

I'm writing a Telegram bot that provides button choices to the user. I'd like to ensure the user chooses from one of the buttons, rather than sending a custom text message or sticker or whatever. Is there some way to do this? As far as I can tell from the docs I can't.

CallMeStag
  • 5,467
  • 1
  • 7
  • 22
digitalWestie
  • 2,647
  • 6
  • 28
  • 45
  • 2
    You are correct. It is impossible to deprive user of entering and sending arbitrary text. – Andrej Kirejeŭ Mar 23 '22 at 13:23
  • 1
    You can't disable the text input as this is core functionality of the app. (Inline) Keyboards can be used with some additional logic that will ask the user to press one of the buttons if a text message is received. If the bot has the power, it could delete any text messages when a button is present. – 0stone0 Mar 24 '22 at 13:45

2 Answers2

2

The answer is no! I am going to handle this by getting the bot to ignore any text input until the user selects one of the button options.

digitalWestie
  • 2,647
  • 6
  • 28
  • 45
2

I came here looking for the complete disabling of the keyboard. but so far, I'm making the bot tell the user to choose only from the buttons (better than ignoring random input IMHO).