Module

x/grammy/mod.ts>InlineKeyboard#text

The Telegram Bot Framework.
Very Popular
Go to Latest
method InlineKeyboard.prototype.text
import { InlineKeyboard } from "https://dotland.deno.dev/x/grammy@v1.20.0/mod.ts";

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

Parameters

text: string

The text to display

optional
data = [UNSUPPORTED]

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