Skip to content
Advertisement

Telegram Keyboard layout/commands

I already know how to setup the custom keybord layout but so far I haven’t found a way to show different “text” on the buttons than what is send if you push it. E.g.:

kb = [
    [telegram.KeyboardButton(text='/new')],
    [telegram.KeyboardButton(text='Edit')],
]
kb_markup = telegram.ReplyKeyboardMarkup(kb)`

It returns the text given and there doesnt seem to be an option to specify what should be returned/shown on screen upon clicking. Upon starting conversation with a bot it says “Start” but sends /start, is there a way to achieve this?

Advertisement

Answer

For KeyboardButton it is always returning the button text as messages sent from the user, if you want the data sent back to the bot not being shown/different from the button text, try using InlineKeyboardButton

And as for the /start button, it is on telegram’s side, we cannot change that.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement