CallbackQuery Class
extends BaseThis 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.
Properties
chatInstance: string
client: Client
data: string
from: User
gameShortName: string
id: string
inlineMessageId: string
message: Message
Methods
answer(options: CallbackQueryAnswerOptions)
{ "id": 673, "name": "CallbackQuery", "variant": "declaration", "kind": 128, "flags": {}, "comment": { "summary": [ { "kind": "text", "text": "This object represents an incoming callback query from a callback button in an inline keyboard.\nIf the button that originated the query was attached to a message sent by the bot, the field message will be present.\nIf the button was attached to a message sent via the bot (in inline mode),\nthe field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present." } ] }, "children": [ { "id": 674, "name": "constructor", "variant": "declaration", "kind": 512, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/CallbackQuery.ts", "line": 42, "character": 1 } ], "signatures": [ { "id": 675, "name": "new CallbackQuery", "variant": "signature", "kind": 16384, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/CallbackQuery.ts", "line": 42, "character": 1 } ], "parameters": [ { "id": 676, "name": "client", "variant": "param", "kind": 32768, "flags": {}, "type": { "type": "reference", "target": 1, "name": "Client", "package": "tgkit", "qualifiedName": "default" } }, { "id": 677, "name": "data", "variant": "param", "kind": 32768, "flags": {}, "type": { "type": "intrinsic", "name": "any" } } ], "type": { "type": "reference", "target": 673, "name": "CallbackQuery", "package": "tgkit", "qualifiedName": "default" }, "overwrites": { "type": "reference", "target": -1, "name": "Base.constructor" } } ], "overwrites": { "type": "reference", "target": -1, "name": "Base.constructor" } }, { "id": 682, "name": "chatInstance", "variant": "declaration", "kind": 1024, "flags": { "isOptional": true }, "comment": { "summary": [ { "kind": "text", "text": "Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent.\nUseful for high scores in games." } ] }, "sources": [ { "fileName": "packages/tgkit/src/structures/CallbackQuery.ts", "line": 33, "character": 1 } ], "type": { "type": "intrinsic", "name": "string" } }, { "id": 688, "name": "client", "variant": "declaration", "kind": 1024, "flags": { "isInherited": true }, "sources": [ { "fileName": "packages/tgkit/src/structures/Base.ts", "line": 4, "character": 1 } ], "type": { "type": "reference", "target": 1, "name": "Client", "package": "tgkit", "qualifiedName": "default" }, "inheritedFrom": { "type": "reference", "target": -1, "name": "Base.client" } }, { "id": 683, "name": "data", "variant": "declaration", "kind": 1024, "flags": { "isOptional": true }, "comment": { "summary": [ { "kind": "text", "text": "Data associated with the callback button. Be aware that a bad client can send arbitrary data in this field." } ] }, "sources": [ { "fileName": "packages/tgkit/src/structures/CallbackQuery.ts", "line": 36, "character": 1 } ], "type": { "type": "intrinsic", "name": "string" } }, { "id": 679, "name": "from", "variant": "declaration", "kind": 1024, "flags": {}, "comment": { "summary": [ { "kind": "text", "text": "Sender" } ] }, "sources": [ { "fileName": "packages/tgkit/src/structures/CallbackQuery.ts", "line": 18, "character": 1 } ], "type": { "type": "reference", "target": 1888, "name": "User", "package": "tgkit", "qualifiedName": "default" } }, { "id": 684, "name": "gameShortName", "variant": "declaration", "kind": 1024, "flags": { "isOptional": true }, "comment": { "summary": [ { "kind": "text", "text": "Short name of a Game to be returned, serves as the unique identifier for the game" } ] }, "sources": [ { "fileName": "packages/tgkit/src/structures/CallbackQuery.ts", "line": 39, "character": 1 } ], "type": { "type": "intrinsic", "name": "string" } }, { "id": 678, "name": "id", "variant": "declaration", "kind": 1024, "flags": {}, "comment": { "summary": [ { "kind": "text", "text": "Unique identifier for this query" } ] }, "sources": [ { "fileName": "packages/tgkit/src/structures/CallbackQuery.ts", "line": 15, "character": 1 } ], "type": { "type": "intrinsic", "name": "string" } }, { "id": 681, "name": "inlineMessageId", "variant": "declaration", "kind": 1024, "flags": { "isOptional": true }, "comment": { "summary": [ { "kind": "text", "text": "Identifier of the message sent via the bot in inline mode, that originated the query." } ] }, "sources": [ { "fileName": "packages/tgkit/src/structures/CallbackQuery.ts", "line": 27, "character": 1 } ], "type": { "type": "intrinsic", "name": "string" } }, { "id": 680, "name": "message", "variant": "declaration", "kind": 1024, "flags": { "isOptional": true }, "comment": { "summary": [ { "kind": "text", "text": "Message with the callback button that originated the query.\nNote that message content and message date will not be available if the message is too old." } ] }, "sources": [ { "fileName": "packages/tgkit/src/structures/CallbackQuery.ts", "line": 24, "character": 1 } ], "type": { "type": "reference", "target": 1495, "name": "Message", "package": "tgkit", "qualifiedName": "default" } }, { "id": 685, "name": "answer", "variant": "declaration", "kind": 2048, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/CallbackQuery.ts", "line": 54, "character": 7 } ], "signatures": [ { "id": 686, "name": "answer", "variant": "signature", "kind": 4096, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/CallbackQuery.ts", "line": 54, "character": 7 } ], "parameters": [ { "id": 687, "name": "options", "variant": "param", "kind": 32768, "flags": {}, "type": { "type": "reference", "target": 2378, "name": "CallbackQueryAnswerOptions", "package": "tgkit" } } ], "type": { "type": "reference", "target": { "sourceFileName": "node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es5.d.ts", "qualifiedName": "Promise" }, "typeArguments": [ { "type": "intrinsic", "name": "void" } ], "name": "Promise", "package": "typescript" } } ] } ], "groups": [ { "title": "Constructors", "children": [ 674 ] }, { "title": "Properties", "children": [ 682, 688, 683, 679, 684, 678, 681, 680 ] }, { "title": "Methods", "children": [ 685 ] } ], "sources": [ { "fileName": "packages/tgkit/src/structures/CallbackQuery.ts", "line": 13, "character": 21 } ], "extendedTypes": [ { "type": "reference", "target": { "sourceFileName": "packages/tgkit/src/structures/Base.ts", "qualifiedName": "default" }, "name": "default", "package": "tgkit" } ] }