Skip to main content
Very Popular
Go to Latest
method InlineKeyboard.prototype.text
import { InlineKeyboard } from "";

Adds a new callback query button. The button contains a text and a custom payload. This payload will be sent back to your bot when the button is pressed. If you omit the payload, the display text will be sent back to your bot.

Your bot will receive an update every time a user presses any of the text buttons. You can listen to these updates like this:

// Specific buttons:
bot.callbackQuery('button-data', ctx => { ... })
// Any button of any inline keyboard:
bot.on('callback_query:data',    ctx => { ... })


text: string

The text to display


The callback data to send back to your bot (default = text)