telegramx.js

InlineKeyboardBuilder

class

Fluent builder for an inline keyboard (InlineKeyboardMarkup). Buttons are added to the current row; call to start a new one.

Declaration

declare class InlineKeyboardBuilder 

Methods

buttonmethod#
button(button: T.InlineKeyboardButton): this;
ParameterType
buttonT.InlineKeyboardButton
Returns this

Add a fully-specified button to the current row.

callbackmethod#
callback(text: string, data: string): this;
ParameterType
textstring
datastring
Returns this

Add a button that sends a callback query with data.

copyTextmethod#
copyText(text: string, copy: string): this;
ParameterType
textstring
copystring
Returns this

Add a button that copies text to the clipboard.

loginmethod#
login(text: string, loginUrl: T.LoginUrl): this;
ParameterType
textstring
loginUrlT.LoginUrl
Returns this

Add a button that logs the user in via Telegram Login.

paymethod#
pay(text: string): this;
ParameterType
textstring
Returns this

Add a Pay button (for invoices).

rowmethod#
row(): this;
Returns this

Start a new row of buttons.

switchInline(text: string, query?: string): this;
ParameterType
textstring
query?string
Returns this

Add a button that switches to inline mode in a chosen chat.

switchInlineCurrent(text: string, query?: string): this;
ParameterType
textstring
query?string
Returns this

Add a button that switches to inline mode in the current chat.

toJSONmethod#

Produce the InlineKeyboardMarkup object, dropping any trailing empty row.

urlmethod#
url(text: string, url: string): this;
ParameterType
textstring
urlstring
Returns this

Add a URL button.

webAppmethod#
webApp(text: string, url: string): this;
ParameterType
textstring
urlstring
Returns this

Add a button that launches a Web App.