Skip to main content
Deno 2 is finally here 🎉️
Learn more
Very Popular
Go to Latest
method InlineKeyboard.text
import { InlineKeyboard } from "https://deno.land/x/grammy@v1.19.1/convenience/keyboard.ts";

Creates 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 => { ... })

Parameters

text: string

The text to display

optional
data = [UNSUPPORTED]

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

Returns

InlineKeyboardButton.CallbackButton