This question has already been answered:

There is a need to make a custom keyboard with numbers in order for the user to enter a number, for example, 900.

But here I ran into another problem, if the user starts entering this number, then in fact it will be sent in the form of three messages - "9", "0", "0".

Is it possible not to send a message while the user enters data, and by pressing the additional buttons (for example, to make Enter) to send everything in one message?

Reported as a duplicate by participants aleksandr barakin , Vanya Avchyan , VladD , Flowneee , fori1ton Jun 1 '17 at 11:42 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

  • There is no such possibility. You can, of course, navigate something with an inline-keyboard , but it is unlikely to replace the typed text in the message input field. - mymedia
  • Thank. Sad of course, but not fatal =) - Xenosiv
  • See how the numeric keypad is implemented in t.me/calculator_bot (nothing unusual, just a calculator via telegrams: D) - mymedia

1 answer 1

This is done using InlineKeyboard . The numbers dialed by the user can be recorded in caption or in the body of the message itself, which will own the keyboard. After pressing the Enter button, process the caption or text of the message with the stored digits, thus there is no need to send the message as if using a regular keyboard.