@grom.js/bot-api-spec 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +15 -15
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  //#region src/bot-api/methods.gen.ts
2
2
  const getUpdates = {
3
3
  name: "getUpdates",
4
- description: { markdown: "Use this method to receive incoming updates using long polling ([wiki](https://en.wikipedia.org/wiki/Push_technology#Long_polling)). Returns an Array of [Update](https://core.telegram.org/bots/api#update) objects.\n\n> **Notes** \n> **1.** This method will not work if an outgoing webhook is set up. \n> **2.** In order to avoid getting duplicate updates, recalculate _offset_ after each server response." },
4
+ description: { markdown: "Use this method to receive incoming updates using long polling ([wiki](https://en.wikipedia.org/wiki/Push_technology#Long_polling)). Returns an Array of [Update](https://core.telegram.org/bots/api#update) objects.\n\n> **Notes**\n> \n> **1.** This method will not work if an outgoing webhook is set up.\n> \n> **2.** In order to avoid getting duplicate updates, recalculate _offset_ after each server response." },
5
5
  parameters: [
6
6
  {
7
7
  name: "offset",
@@ -30,7 +30,7 @@ const getUpdates = {
30
30
  type: "array",
31
31
  of: { type: "str" }
32
32
  },
33
- description: { markdown: "An array of the update types you want your bot to receive. For example, specify `[\"message\", \"edited_channel_post\", \"callback_query\"]` to only receive updates of these types. See [Update](https://core.telegram.org/bots/api#update) for a complete list of available update types. Specify an empty list to receive all update types except _chat\\_member_, _message\\_reaction_, and _message\\_reaction\\_count_ (default). If not specified, the previous setting will be used. \n \nPlease note that this parameter doesn't affect updates created before the call to getUpdates, so unwanted updates may be received for a short period of time." },
33
+ description: { markdown: "An array of the update types you want your bot to receive. For example, specify `[\"message\", \"edited_channel_post\", \"callback_query\"]` to only receive updates of these types. See [Update](https://core.telegram.org/bots/api#update) for a complete list of available update types. Specify an empty list to receive all update types except _chat\\_member_, _message\\_reaction_, and _message\\_reaction\\_count_ (default). If not specified, the previous setting will be used.\n\nPlease note that this parameter doesn't affect updates created before the call to getUpdates, so unwanted updates may be received for a short period of time." },
34
34
  required: false,
35
35
  jsonSerialized: true
36
36
  }
@@ -45,7 +45,7 @@ const getUpdates = {
45
45
  };
46
46
  const setWebhook = {
47
47
  name: "setWebhook",
48
- description: { markdown: "Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized [Update](https://core.telegram.org/bots/api#update). In case of an unsuccessful request (a request with response [HTTP status code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) different from `2XY`), we will repeat the request and give up after a reasonable amount of attempts. Returns _True_ on success.\n\nIf you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter _secret\\_token_. If specified, the request will contain a header “X-Telegram-Bot-Api-Secret-Token” with the secret token as content.\n\n> **Notes** \n> **1.** You will not be able to receive updates using [getUpdates](https://core.telegram.org/bots/api#getupdates) for as long as an outgoing webhook is set up. \n> **2.** To use a self-signed certificate, you need to upload your [public key certificate](https://core.telegram.org/bots/self-signed) using _certificate_ parameter. Please upload as InputFile, sending a String will not work. \n> **3.** Ports currently supported _for webhooks_: **443, 80, 88, 8443**.\n> \n> If you're having any trouble setting up webhooks, please check out this [amazing guide to webhooks](https://core.telegram.org/bots/webhooks)." },
48
+ description: { markdown: "Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized [Update](https://core.telegram.org/bots/api#update). In case of an unsuccessful request (a request with response [HTTP status code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) different from `2XY`), we will repeat the request and give up after a reasonable amount of attempts. Returns _True_ on success.\n\nIf you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter _secret\\_token_. If specified, the request will contain a header “X-Telegram-Bot-Api-Secret-Token” with the secret token as content.\n\n> **Notes**\n> \n> **1.** You will not be able to receive updates using [getUpdates](https://core.telegram.org/bots/api#getupdates) for as long as an outgoing webhook is set up.\n> \n> **2.** To use a self-signed certificate, you need to upload your [public key certificate](https://core.telegram.org/bots/self-signed) using _certificate_ parameter. Please upload as InputFile, sending a String will not work.\n> \n> **3.** Ports currently supported _for webhooks_: **443, 80, 88, 8443**.\n> \n> If you're having any trouble setting up webhooks, please check out this [amazing guide to webhooks](https://core.telegram.org/bots/webhooks)." },
49
49
  parameters: [
50
50
  {
51
51
  name: "url",
@@ -81,7 +81,7 @@ const setWebhook = {
81
81
  type: "array",
82
82
  of: { type: "str" }
83
83
  },
84
- description: { markdown: "An array of the update types you want your bot to receive. For example, specify `[\"message\", \"edited_channel_post\", \"callback_query\"]` to only receive updates of these types. See [Update](https://core.telegram.org/bots/api#update) for a complete list of available update types. Specify an empty list to receive all update types except _chat\\_member_, _message\\_reaction_, and _message\\_reaction\\_count_ (default). If not specified, the previous setting will be used. \nPlease note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time." },
84
+ description: { markdown: "An array of the update types you want your bot to receive. For example, specify `[\"message\", \"edited_channel_post\", \"callback_query\"]` to only receive updates of these types. See [Update](https://core.telegram.org/bots/api#update) for a complete list of available update types. Specify an empty list to receive all update types except _chat\\_member_, _message\\_reaction_, and _message\\_reaction\\_count_ (default). If not specified, the previous setting will be used.\n\nPlease note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time." },
85
85
  required: false,
86
86
  jsonSerialized: true
87
87
  },
@@ -4587,7 +4587,7 @@ const answerCallbackQuery = {
4587
4587
  {
4588
4588
  name: "url",
4589
4589
  type: { type: "str" },
4590
- description: { markdown: "URL that will be opened by the user's client. If you have created a [Game](https://core.telegram.org/bots/api#game) and accepted the conditions via [@BotFather](https://t.me/botfather), specify the URL that opens your game - note that this will only work if the query comes from a [_callback\\_game_](https://core.telegram.org/bots/api#inlinekeyboardbutton) button. \n \nOtherwise, you may use links like `t.me/your_bot?start=XXXX` that open your bot with a parameter." },
4590
+ description: { markdown: "URL that will be opened by the user's client. If you have created a [Game](https://core.telegram.org/bots/api#game) and accepted the conditions via [@BotFather](https://t.me/botfather), specify the URL that opens your game - note that this will only work if the query comes from a [_callback\\_game_](https://core.telegram.org/bots/api#inlinekeyboardbutton) button.\n\nOtherwise, you may use links like `t.me/your_bot?start=XXXX` that open your bot with a parameter." },
4591
4591
  required: false,
4592
4592
  jsonSerialized: false
4593
4593
  },
@@ -6351,7 +6351,7 @@ const declineSuggestedPost = {
6351
6351
  };
6352
6352
  const deleteMessage = {
6353
6353
  name: "deleteMessage",
6354
- description: { markdown: "Use this method to delete a message, including service messages, with the following limitations: \n\\- A message can only be deleted if it was sent less than 48 hours ago. \n\\- Service messages about a supergroup, channel, or forum topic creation can't be deleted. \n\\- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago. \n\\- Bots can delete outgoing messages in private chats, groups, and supergroups. \n\\- Bots can delete incoming messages in private chats. \n\\- Bots granted _can\\_post\\_messages_ permissions can delete outgoing messages in channels. \n\\- If the bot is an administrator of a group, it can delete any message there. \n\\- If the bot has _can\\_delete\\_messages_ administrator right in a supergroup or a channel, it can delete any message there. \n\\- If the bot has _can\\_manage\\_direct\\_messages_ administrator right in a channel, it can delete any message in the corresponding direct messages chat. \nReturns _True_ on success." },
6354
+ description: { markdown: "Use this method to delete a message, including service messages, with the following limitations:\n\n\\- A message can only be deleted if it was sent less than 48 hours ago.\n\n\\- Service messages about a supergroup, channel, or forum topic creation can't be deleted.\n\n\\- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.\n\n\\- Bots can delete outgoing messages in private chats, groups, and supergroups.\n\n\\- Bots can delete incoming messages in private chats.\n\n\\- Bots granted _can\\_post\\_messages_ permissions can delete outgoing messages in channels.\n\n\\- If the bot is an administrator of a group, it can delete any message there.\n\n\\- If the bot has _can\\_delete\\_messages_ administrator right in a supergroup or a channel, it can delete any message there.\n\n\\- If the bot has _can\\_manage\\_direct\\_messages_ administrator right in a channel, it can delete any message in the corresponding direct messages chat.\n\nReturns _True_ on success." },
6355
6355
  parameters: [{
6356
6356
  name: "chat_id",
6357
6357
  type: {
@@ -6941,7 +6941,7 @@ const deleteStickerSet = {
6941
6941
  };
6942
6942
  const answerInlineQuery = {
6943
6943
  name: "answerInlineQuery",
6944
- description: { markdown: "Use this method to send answers to an inline query. On success, _True_ is returned. \nNo more than **50** results per query are allowed." },
6944
+ description: { markdown: "Use this method to send answers to an inline query. On success, _True_ is returned.\n\nNo more than **50** results per query are allowed." },
6945
6945
  parameters: [
6946
6946
  {
6947
6947
  name: "inline_query_id",
@@ -8043,7 +8043,7 @@ const methods = {
8043
8043
  const t = (apiType) => apiType;
8044
8044
  const Update = t({
8045
8045
  name: "Update",
8046
- description: { markdown: "This [object](https://core.telegram.org/bots/api#available-types) represents an incoming update. \nAt most **one** of the optional parameters can be present in any given update." },
8046
+ description: { markdown: "This [object](https://core.telegram.org/bots/api#available-types) represents an incoming update.\n\nAt most **one** of the optional parameters can be present in any given update." },
8047
8047
  fields: [
8048
8048
  {
8049
8049
  name: "update_id",
@@ -13054,7 +13054,7 @@ const ReplyKeyboardMarkup = t({
13054
13054
  {
13055
13055
  name: "selective",
13056
13056
  type: { type: "bool" },
13057
- description: { markdown: "Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the _text_ of the [Message](https://core.telegram.org/bots/api#message) object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message. \n \n_Example:_ A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard." },
13057
+ description: { markdown: "Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the _text_ of the [Message](https://core.telegram.org/bots/api#message) object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.\n\n_Example:_ A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard." },
13058
13058
  required: false,
13059
13059
  jsonSerialized: false
13060
13060
  }
@@ -13297,7 +13297,7 @@ const ReplyKeyboardRemove = t({
13297
13297
  }, {
13298
13298
  name: "selective",
13299
13299
  type: { type: "bool" },
13300
- description: { markdown: "Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the _text_ of the [Message](https://core.telegram.org/bots/api#message) object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message. \n \n_Example:_ A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet." },
13300
+ description: { markdown: "Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the _text_ of the [Message](https://core.telegram.org/bots/api#message) object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.\n\n_Example:_ A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet." },
13301
13301
  required: false,
13302
13302
  jsonSerialized: false
13303
13303
  }]
@@ -13377,7 +13377,7 @@ const InlineKeyboardButton = t({
13377
13377
  {
13378
13378
  name: "switch_inline_query_current_chat",
13379
13379
  type: { type: "str" },
13380
- description: { markdown: "If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted. \n \nThis offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options. Not supported in channels and for messages sent in channel direct messages chats and on behalf of a Telegram Business account." },
13380
+ description: { markdown: "If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted.\n\nThis offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options. Not supported in channels and for messages sent in channel direct messages chats and on behalf of a Telegram Business account." },
13381
13381
  required: false,
13382
13382
  jsonSerialized: false
13383
13383
  },
@@ -13407,14 +13407,14 @@ const InlineKeyboardButton = t({
13407
13407
  type: "api-type",
13408
13408
  name: "CallbackGame"
13409
13409
  },
13410
- description: { markdown: "Description of the game that will be launched when the user presses the button. \n \n**NOTE:** This type of button **must** always be the first button in the first row." },
13410
+ description: { markdown: "Description of the game that will be launched when the user presses the button.\n\n**NOTE:** This type of button **must** always be the first button in the first row." },
13411
13411
  required: false,
13412
13412
  jsonSerialized: false
13413
13413
  },
13414
13414
  {
13415
13415
  name: "pay",
13416
13416
  type: { type: "bool" },
13417
- description: { markdown: "Specify _True_, to send a [Pay button](https://core.telegram.org/bots/api#payments). Substrings “![⭐](//telegram.org/img/emoji/40/E2AD90.png)” and “XTR” in the buttons's text will be replaced with a Telegram Star icon. \n \n**NOTE:** This type of button **must** always be the first button in the first row and can only be used in invoice messages." },
13417
+ description: { markdown: "Specify _True_, to send a [Pay button](https://core.telegram.org/bots/api#payments). Substrings “![⭐](//telegram.org/img/emoji/40/E2AD90.png)” and “XTR” in the buttons's text will be replaced with a Telegram Star icon.\n\n**NOTE:** This type of button **must** always be the first button in the first row and can only be used in invoice messages." },
13418
13418
  required: false,
13419
13419
  jsonSerialized: false
13420
13420
  }
@@ -13427,7 +13427,7 @@ const LoginUrl = t({
13427
13427
  {
13428
13428
  name: "url",
13429
13429
  type: { type: "str" },
13430
- description: { markdown: "An HTTPS URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in [Receiving authorization data](https://core.telegram.org/widgets/login#receiving-authorization-data). \n \n**NOTE:** You **must** always check the hash of the received data to verify the authentication and the integrity of the data as described in [Checking authorization](https://core.telegram.org/widgets/login#checking-authorization)." },
13430
+ description: { markdown: "An HTTPS URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in [Receiving authorization data](https://core.telegram.org/widgets/login#receiving-authorization-data).\n\n**NOTE:** You **must** always check the hash of the received data to verify the authentication and the integrity of the data as described in [Checking authorization](https://core.telegram.org/widgets/login#checking-authorization)." },
13431
13431
  required: true,
13432
13432
  jsonSerialized: false
13433
13433
  },
@@ -17562,7 +17562,7 @@ const InlineQueryResultsButton = t({
17562
17562
  {
17563
17563
  name: "start_parameter",
17564
17564
  type: { type: "str" },
17565
- description: { markdown: "[Deep-linking](https://core.telegram.org/bots/features#deep-linking) parameter for the /start message sent to the bot when a user presses the button. 1-64 characters, only `A-Z`, `a-z`, `0-9`, `_` and `-` are allowed. \n \n_Example:_ An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a 'Connect your YouTube account' button above the results, or even before showing any. The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an OAuth link. Once done, the bot can offer a [_switch\\_inline_](https://core.telegram.org/bots/api#inlinekeyboardmarkup) button so that the user can easily return to the chat where they wanted to use the bot's inline capabilities." },
17565
+ description: { markdown: "[Deep-linking](https://core.telegram.org/bots/features#deep-linking) parameter for the /start message sent to the bot when a user presses the button. 1-64 characters, only `A-Z`, `a-z`, `0-9`, `_` and `-` are allowed.\n\n_Example:_ An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a 'Connect your YouTube account' button above the results, or even before showing any. The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an OAuth link. Once done, the bot can offer a [_switch\\_inline_](https://core.telegram.org/bots/api#inlinekeyboardmarkup) button so that the user can easily return to the chat where they wanted to use the bot's inline capabilities." },
17566
17566
  required: false,
17567
17567
  jsonSerialized: false
17568
17568
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@grom.js/bot-api-spec",
3
3
  "type": "module",
4
- "version": "0.3.1",
4
+ "version": "0.3.2",
5
5
  "description": "Telegram Bot API specification as a collection of JavaScript objects in a custom format.",
6
6
  "license": "MIT",
7
7
  "repository": {