Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Number keyboard for python-telegram-bot

I am currently creating a telegram bot using python-telegram-bot. For some questions in the bot I need a number keyboard displayed to the user. I tried:

number_keys = [
               ['7', '8', '9'],
               ['4', '5', '6'],
               ['1', '2', '3'],
                    ['0']
              ]
    
number_keyboard = ReplyKeyboardMarkup(number_keys)

Unfortunately the user can only input one digit, but I want also multidigit numbers to be possible. Do you have any suggestions?

Thank you in advance,

Sören

like image 477
Sören Etler Avatar asked Dec 30 '25 11:12

Sören Etler


1 Answers

Use InlineKeyboardButton instead and update message with values using edit_text or edit_reply_markup to show what was already typed.

like image 174
wowkin2 Avatar answered Jan 01 '26 02:01

wowkin2



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!