Skip to content

GramIO API Reference / @gramio/contexts/dist / CallbackQuery

Class: CallbackQuery

Defined in: contexts/index.d.ts:3644

This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present.

Extended by

Constructors

Constructor

new CallbackQuery(payload): CallbackQuery

Defined in: contexts/index.d.ts:3646

Parameters

ParameterType
payloadTelegramCallbackQuery

Returns

CallbackQuery

Properties

PropertyTypeDefined in
payloadTelegramCallbackQuerycontexts/index.d.ts:3645

Accessors

[toStringTag]

Get Signature

get [toStringTag](): string

Defined in: contexts/index.d.ts:3648

MDN

Returns

string


chatInstance

Get Signature

get chatInstance(): string

Defined in: contexts/index.d.ts:3668

Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games.

Returns

string


data

Get Signature

get data(): string

Defined in: contexts/index.d.ts:3673

Data associated with the callback button. Be aware that a bad client can send arbitrary data in this field.

Returns

string

Set Signature

set data(data): void

Defined in: contexts/index.d.ts:3674

Parameters
ParameterType
datastring
Returns

void


from

Get Signature

get from(): User

Defined in: contexts/index.d.ts:3652

Sender

Returns

User


gameShortName

Get Signature

get gameShortName(): string

Defined in: contexts/index.d.ts:3679

Short name of a Game to be returned, serves as the unique identifier for the game

Returns

string


id

Get Signature

get id(): string

Defined in: contexts/index.d.ts:3650

Unique identifier for this query

Returns

string


inlineMessageId

Get Signature

get inlineMessageId(): string

Defined in: contexts/index.d.ts:3663

Identifier of the message sent via the bot in inline mode, that originated the query.

Returns

string


message

Get Signature

get message(): Message | InaccessibleMessage

Defined in: contexts/index.d.ts:3658

Message sent by the bot with the callback button that originated the query

Returns

Message | InaccessibleMessage


senderId

Get Signature

get senderId(): number

Defined in: contexts/index.d.ts:3654

Sender ID

Returns

number