Skip to content

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

Class: CallbackQuery

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

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:3312

Parameters

ParameterType
payloadTelegramCallbackQuery

Returns

CallbackQuery

Properties

PropertyTypeDefined in
payloadTelegramCallbackQuerycontexts/index.d.ts:3311

Accessors

[toStringTag]

Get Signature

get [toStringTag](): string

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

MDN

Returns

string


chatInstance

Get Signature

get chatInstance(): string

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

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:3339

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:3340

Parameters
ParameterType
datastring
Returns

void


from

Get Signature

get from(): User

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

Sender

Returns

User


gameShortName

Get Signature

get gameShortName(): string

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

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:3316

Unique identifier for this query

Returns

string


inlineMessageId

Get Signature

get inlineMessageId(): string

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

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:3324

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:3320

Sender ID

Returns

number