InlineKeyboardButton Class
Represents one button of an inline keyboard. You must use exactly one of the optional fields.
Properties
callbackData: string
callbackGame: CallbackGame
loginUrl: LoginUrl
pay: boolean
switchInlineQuery: string
switchInlineQueryCurrentChat: string
text: string
url: string
webApp: WebAppInfo
Methods
setCallbackData(callbackData: string)
setLoginUrl(loginUrl: LoginUrl)
setPay(pay: boolean)
setSwitchInlineQuery(switchInlineQuery: string)
setSwitchInlineQueryCurrentChat(switchInlineQueryCurrentChat: string)
setText(text: string)
setUrl(url: string)
setWebApp(webApp: WebAppInfo)
toJSON()
{ "id": 1340, "name": "InlineKeyboardButton", "variant": "declaration", "kind": 128, "flags": {}, "comment": { "summary": [ { "kind": "text", "text": "Represents one button of an inline keyboard. You must use exactly one of the optional fields." } ] }, "children": [ { "id": 1341, "name": "constructor", "variant": "declaration", "kind": 512, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 50, "character": 1 } ], "signatures": [ { "id": 1342, "name": "new InlineKeyboardButton", "variant": "signature", "kind": 16384, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 50, "character": 1 } ], "parameters": [ { "id": 1343, "name": "data", "variant": "param", "kind": 32768, "flags": {}, "type": { "type": "reference", "target": 2385, "name": "InlineKeyboardButtonData", "package": "tgkit" } } ], "type": { "type": "reference", "target": 1340, "name": "InlineKeyboardButton", "package": "tgkit", "qualifiedName": "default" } } ] }, { "id": 1347, "name": "callbackData", "variant": "declaration", "kind": 1024, "flags": { "isOptional": true }, "comment": { "summary": [ { "kind": "text", "text": "Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes" } ] }, "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 19, "character": 1 } ], "type": { "type": "intrinsic", "name": "string" } }, { "id": 1351, "name": "callbackGame", "variant": "declaration", "kind": 1024, "flags": { "isOptional": true }, "comment": { "summary": [ { "kind": "text", "text": "Description of the game that will be launched when the user presses the button." } ] }, "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 42, "character": 1 } ], "type": { "type": "reference", "target": 668, "name": "CallbackGame", "package": "tgkit", "qualifiedName": "default" } }, { "id": 1346, "name": "loginUrl", "variant": "declaration", "kind": 1024, "flags": { "isOptional": true }, "comment": { "summary": [ { "kind": "text", "text": "An HTTP URL used to automatically authorize the user.\nCan be used as a replacement for the Telegram Login Widget." } ] }, "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 16, "character": 1 } ], "type": { "type": "reference", "target": 2103, "name": "LoginUrl", "package": "tgkit" } }, { "id": 1352, "name": "pay", "variant": "declaration", "kind": 1024, "flags": { "isOptional": true }, "comment": { "summary": [ { "kind": "text", "text": "Specify *true*, to send a Pay button. NOTE: This type of button must always be the first button in the first row\nand can only be used in invoice messages." } ] }, "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 48, "character": 1 } ], "type": { "type": "intrinsic", "name": "boolean" } }, { "id": 1349, "name": "switchInlineQuery", "variant": "declaration", "kind": 1024, "flags": { "isOptional": true }, "comment": { "summary": [ { "kind": "text", "text": "If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the\nbot's username and the specified inline query in the input field. Can be empty, in which case just the bot's\nusername will be inserted." } ] }, "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 33, "character": 1 } ], "type": { "type": "intrinsic", "name": "string" } }, { "id": 1350, "name": "switchInlineQueryCurrentChat", "variant": "declaration", "kind": 1024, "flags": { "isOptional": true }, "comment": { "summary": [ { "kind": "text", "text": "If set, pressing the button will insert the bot's username and the specified inline query in the current chat's\ninput field. Can be empty, in which case only the bot's username will be inserted." } ] }, "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 39, "character": 1 } ], "type": { "type": "intrinsic", "name": "string" } }, { "id": 1344, "name": "text", "variant": "declaration", "kind": 1024, "flags": { "isOptional": true }, "comment": { "summary": [ { "kind": "text", "text": "Label text on the button" } ] }, "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 7, "character": 1 } ], "type": { "type": "intrinsic", "name": "string" } }, { "id": 1345, "name": "url", "variant": "declaration", "kind": 1024, "flags": { "isOptional": true }, "comment": { "summary": [ { "kind": "text", "text": "HTTP or tg:// url to be opened when the button is pressed. Links tg://user?id=<userId> can be used to mention a user by their ID without using a username, if this is allowed by their privacy settings." } ] }, "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 10, "character": 1 } ], "type": { "type": "intrinsic", "name": "string" } }, { "id": 1348, "name": "webApp", "variant": "declaration", "kind": 1024, "flags": { "isOptional": true }, "comment": { "summary": [ { "kind": "text", "text": "Description of the Web App that will be launched when the user presses the button. The Web App will be able to\nsend an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private\nchats between a user and the bot." } ] }, "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 26, "character": 1 } ], "type": { "type": "reference", "target": 2334, "name": "WebAppInfo", "package": "tgkit" } }, { "id": 1362, "name": "setCallbackData", "variant": "declaration", "kind": 2048, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 76, "character": 1 } ], "signatures": [ { "id": 1363, "name": "setCallbackData", "variant": "signature", "kind": 4096, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 76, "character": 1 } ], "parameters": [ { "id": 1364, "name": "callbackData", "variant": "param", "kind": 32768, "flags": {}, "type": { "type": "intrinsic", "name": "string" } } ], "type": { "type": "reference", "target": 1340, "name": "InlineKeyboardButton", "package": "tgkit", "qualifiedName": "default" } } ] }, { "id": 1359, "name": "setLoginUrl", "variant": "declaration", "kind": 2048, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 71, "character": 1 } ], "signatures": [ { "id": 1360, "name": "setLoginUrl", "variant": "signature", "kind": 4096, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 71, "character": 1 } ], "parameters": [ { "id": 1361, "name": "loginUrl", "variant": "param", "kind": 32768, "flags": {}, "type": { "type": "reference", "target": 2103, "name": "LoginUrl", "package": "tgkit" } } ], "type": { "type": "reference", "target": 1340, "name": "InlineKeyboardButton", "package": "tgkit", "qualifiedName": "default" } } ] }, { "id": 1374, "name": "setPay", "variant": "declaration", "kind": 2048, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 101, "character": 1 } ], "signatures": [ { "id": 1375, "name": "setPay", "variant": "signature", "kind": 4096, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 101, "character": 1 } ], "parameters": [ { "id": 1376, "name": "pay", "variant": "param", "kind": 32768, "flags": {}, "type": { "type": "intrinsic", "name": "boolean" } } ], "type": { "type": "reference", "target": 1340, "name": "InlineKeyboardButton", "package": "tgkit", "qualifiedName": "default" } } ] }, { "id": 1368, "name": "setSwitchInlineQuery", "variant": "declaration", "kind": 2048, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 86, "character": 1 } ], "signatures": [ { "id": 1369, "name": "setSwitchInlineQuery", "variant": "signature", "kind": 4096, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 86, "character": 1 } ], "parameters": [ { "id": 1370, "name": "switchInlineQuery", "variant": "param", "kind": 32768, "flags": {}, "type": { "type": "intrinsic", "name": "string" } } ], "type": { "type": "reference", "target": 1340, "name": "InlineKeyboardButton", "package": "tgkit", "qualifiedName": "default" } } ] }, { "id": 1371, "name": "setSwitchInlineQueryCurrentChat", "variant": "declaration", "kind": 2048, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 91, "character": 1 } ], "signatures": [ { "id": 1372, "name": "setSwitchInlineQueryCurrentChat", "variant": "signature", "kind": 4096, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 91, "character": 1 } ], "parameters": [ { "id": 1373, "name": "switchInlineQueryCurrentChat", "variant": "param", "kind": 32768, "flags": {}, "type": { "type": "intrinsic", "name": "string" } } ], "type": { "type": "reference", "target": 1340, "name": "InlineKeyboardButton", "package": "tgkit", "qualifiedName": "default" } } ] }, { "id": 1353, "name": "setText", "variant": "declaration", "kind": 2048, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 61, "character": 1 } ], "signatures": [ { "id": 1354, "name": "setText", "variant": "signature", "kind": 4096, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 61, "character": 1 } ], "parameters": [ { "id": 1355, "name": "text", "variant": "param", "kind": 32768, "flags": {}, "type": { "type": "intrinsic", "name": "string" } } ], "type": { "type": "reference", "target": 1340, "name": "InlineKeyboardButton", "package": "tgkit", "qualifiedName": "default" } } ] }, { "id": 1356, "name": "setUrl", "variant": "declaration", "kind": 2048, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 66, "character": 1 } ], "signatures": [ { "id": 1357, "name": "setUrl", "variant": "signature", "kind": 4096, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 66, "character": 1 } ], "parameters": [ { "id": 1358, "name": "url", "variant": "param", "kind": 32768, "flags": {}, "type": { "type": "intrinsic", "name": "string" } } ], "type": { "type": "reference", "target": 1340, "name": "InlineKeyboardButton", "package": "tgkit", "qualifiedName": "default" } } ] }, { "id": 1365, "name": "setWebApp", "variant": "declaration", "kind": 2048, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 81, "character": 1 } ], "signatures": [ { "id": 1366, "name": "setWebApp", "variant": "signature", "kind": 4096, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 81, "character": 1 } ], "parameters": [ { "id": 1367, "name": "webApp", "variant": "param", "kind": 32768, "flags": {}, "type": { "type": "reference", "target": 2334, "name": "WebAppInfo", "package": "tgkit" } } ], "type": { "type": "reference", "target": 1340, "name": "InlineKeyboardButton", "package": "tgkit", "qualifiedName": "default" } } ] }, { "id": 1377, "name": "toJSON", "variant": "declaration", "kind": 2048, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 106, "character": 1 } ], "signatures": [ { "id": 1378, "name": "toJSON", "variant": "signature", "kind": 4096, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 106, "character": 1 } ], "type": { "type": "intrinsic", "name": "object" } } ] } ], "groups": [ { "title": "Constructors", "children": [ 1341 ] }, { "title": "Properties", "children": [ 1347, 1351, 1346, 1352, 1349, 1350, 1344, 1345, 1348 ] }, { "title": "Methods", "children": [ 1362, 1359, 1374, 1368, 1371, 1353, 1356, 1365, 1377 ] } ], "sources": [ { "fileName": "packages/tgkit/src/structures/InlineKeyboardButton.ts", "line": 5, "character": 21 } ] }