diff --git a/bun.lock b/bun.lock index bc5e200..c94dd4e 100644 --- a/bun.lock +++ b/bun.lock @@ -1,5 +1,6 @@ { "lockfileVersion": 1, + "configVersion": 0, "workspaces": { "": { "name": "bot-api", diff --git a/scripts/data/return-types.gen.ts b/scripts/data/return-types.gen.ts index 2c0d348..48b57e4 100644 --- a/scripts/data/return-types.gen.ts +++ b/scripts/data/return-types.gen.ts @@ -180,6 +180,12 @@ export const returnTypes: { name: 'Message', }, }, + sendMessageDraft: { + 'Use this method to stream a partial message to a user while the message is being generated; supported only for bots with forum topic mode enabled. Returns _True_ on success.': { + type: 'bool', + literal: true, + }, + }, sendChatAction: { 'Use this method when you need to tell the user that something is happening on the bot\'s side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns _True_ on success.\n\n> Example: The [ImageBot](https://t.me/imagebot) needs some time to process a request and upload the image. Instead of sending a text message along the lines of “Retrieving image, please wait…”, the bot may use [sendChatAction](https://core.telegram.org/bots/api#sendchataction) with _action_ = _upload\\_photo_. The user will see a “sending photo” status for the bot.\n\nWe only recommend using this method when a response from the bot will take a **noticeable** amount of time to arrive.': { type: 'bool', @@ -407,7 +413,7 @@ export const returnTypes: { }, }, editForumTopic: { - 'Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the _can\\_manage\\_topics_ administrator rights, unless it is the creator of the topic. Returns _True_ on success.': { + 'Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the _can\\_manage\\_topics_ administrator rights, unless it is the creator of the topic. Returns _True_ on success.': { type: 'bool', literal: true, }, @@ -425,13 +431,13 @@ export const returnTypes: { }, }, deleteForumTopic: { - 'Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the _can\\_delete\\_messages_ administrator rights. Returns _True_ on success.': { + 'Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the _can\\_delete\\_messages_ administrator rights. Returns _True_ on success.': { type: 'bool', literal: true, }, }, unpinAllForumTopicMessages: { - 'Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the _can\\_pin\\_messages_ administrator right in the supergroup. Returns _True_ on success.': { + 'Use this method to clear the list of pinned messages in a forum topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the _can\\_pin\\_messages_ administrator right in the supergroup. Returns _True_ on success.': { type: 'bool', literal: true, }, @@ -679,6 +685,18 @@ export const returnTypes: { name: 'OwnedGifts', }, }, + getUserGifts: { + 'Returns the gifts owned and hosted by a user. Returns [OwnedGifts](https://core.telegram.org/bots/api#ownedgifts) on success.': { + type: 'api-type', + name: 'OwnedGifts', + }, + }, + getChatGifts: { + 'Returns the gifts owned by a chat. Returns [OwnedGifts](https://core.telegram.org/bots/api#ownedgifts) on success.': { + type: 'api-type', + name: 'OwnedGifts', + }, + }, convertGiftToStars: { 'Converts a given regular gift to Telegram Stars. Requires the _can\\_convert\\_gifts\\_to\\_stars_ business bot right. Returns _True_ on success.': { type: 'bool', @@ -703,6 +721,12 @@ export const returnTypes: { name: 'Story', }, }, + repostStory: { + 'Reposts a story on behalf of a business account from another business account. Both business accounts must be managed by the same bot, and the story on the source account must have been posted (or reposted) by the bot. Requires the _can\\_manage\\_stories_ business bot right for both business accounts. Returns [Story](https://core.telegram.org/bots/api#story) on success.': { + type: 'api-type', + name: 'Story', + }, + }, editStory: { 'Edits a story previously posted by the bot on behalf of a managed business account. Requires the _can\\_manage\\_stories_ business bot right. Returns [Story](https://core.telegram.org/bots/api#story) on success.': { type: 'api-type', diff --git a/src/bot-api/methods.gen.ts b/src/bot-api/methods.gen.ts index 2e9a95b..f1587d8 100644 --- a/src/bot-api/methods.gen.ts +++ b/src/bot-api/methods.gen.ts @@ -276,7 +276,7 @@ const sendMessage: ApiMethod = { type: 'int32', }, description: { - markdown: 'Unique identifier for the target message thread (topic) of the forum; for forum supergroups only', + markdown: 'Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only', }, required: false, jsonSerialized: false, @@ -476,7 +476,7 @@ const forwardMessage: ApiMethod = { type: 'int32', }, description: { - markdown: 'Unique identifier for the target message thread (topic) of the forum; for forum supergroups only', + markdown: 'Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only', }, required: false, jsonSerialized: false, @@ -544,6 +544,17 @@ const forwardMessage: ApiMethod = { required: false, jsonSerialized: false, }, + { + name: 'message_effect_id', + type: { + type: 'str', + }, + description: { + markdown: 'Unique identifier of the message effect to be added to the message; only available when forwarding to private chats', + }, + required: false, + jsonSerialized: false, + }, { name: 'suggested_post_parameters', type: { @@ -605,7 +616,7 @@ const forwardMessages: ApiMethod = { type: 'int32', }, description: { - markdown: 'Unique identifier for the target message thread (topic) of the forum; for forum supergroups only', + markdown: 'Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only', }, required: false, jsonSerialized: false, @@ -717,7 +728,7 @@ const copyMessage: ApiMethod = { type: 'int32', }, description: { - markdown: 'Unique identifier for the target message thread (topic) of the forum; for forum supergroups only', + markdown: 'Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only', }, required: false, jsonSerialized: false, @@ -855,6 +866,17 @@ const copyMessage: ApiMethod = { required: false, jsonSerialized: false, }, + { + name: 'message_effect_id', + type: { + type: 'str', + }, + description: { + markdown: 'Unique identifier of the message effect to be added to the message; only available when copying to private chats', + }, + required: false, + jsonSerialized: false, + }, { name: 'suggested_post_parameters', type: { @@ -946,7 +968,7 @@ const copyMessages: ApiMethod = { type: 'int32', }, description: { - markdown: 'Unique identifier for the target message thread (topic) of the forum; for forum supergroups only', + markdown: 'Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only', }, required: false, jsonSerialized: false, @@ -1080,7 +1102,7 @@ const sendPhoto: ApiMethod = { type: 'int32', }, description: { - markdown: 'Unique identifier for the target message thread (topic) of the forum; for forum supergroups only', + markdown: 'Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only', }, required: false, jsonSerialized: false, @@ -1320,7 +1342,7 @@ const sendAudio: ApiMethod = { type: 'int32', }, description: { - markdown: 'Unique identifier for the target message thread (topic) of the forum; for forum supergroups only', + markdown: 'Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only', }, required: false, jsonSerialized: false, @@ -1590,7 +1612,7 @@ const sendDocument: ApiMethod = { type: 'int32', }, description: { - markdown: 'Unique identifier for the target message thread (topic) of the forum; for forum supergroups only', + markdown: 'Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only', }, required: false, jsonSerialized: false, @@ -1838,7 +1860,7 @@ const sendVideo: ApiMethod = { type: 'int32', }, description: { - markdown: 'Unique identifier for the target message thread (topic) of the forum; for forum supergroups only', + markdown: 'Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only', }, required: false, jsonSerialized: false, @@ -2171,7 +2193,7 @@ const sendAnimation: ApiMethod = { type: 'int32', }, description: { - markdown: 'Unique identifier for the target message thread (topic) of the forum; for forum supergroups only', + markdown: 'Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only', }, required: false, jsonSerialized: false, @@ -2463,7 +2485,7 @@ const sendVoice: ApiMethod = { type: 'int32', }, description: { - markdown: 'Unique identifier for the target message thread (topic) of the forum; for forum supergroups only', + markdown: 'Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only', }, required: false, jsonSerialized: false, @@ -2692,7 +2714,7 @@ const sendVideoNote: ApiMethod = { type: 'int32', }, description: { - markdown: 'Unique identifier for the target message thread (topic) of the forum; for forum supergroups only', + markdown: 'Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only', }, required: false, jsonSerialized: false, @@ -2914,7 +2936,7 @@ const sendPaidMedia: ApiMethod = { type: 'int32', }, description: { - markdown: 'Unique identifier for the target message thread (topic) of the forum; for forum supergroups only', + markdown: 'Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only', }, required: false, jsonSerialized: false, @@ -2936,7 +2958,7 @@ const sendPaidMedia: ApiMethod = { type: 'int32', }, description: { - markdown: 'The number of Telegram Stars that must be paid to buy access to the media; 1-10000', + markdown: 'The number of Telegram Stars that must be paid to buy access to the media; 1-25000', }, required: true, jsonSerialized: false, @@ -3150,7 +3172,7 @@ const sendMediaGroup: ApiMethod = { type: 'int32', }, description: { - markdown: 'Unique identifier for the target message thread (topic) of the forum; for forum supergroups only', + markdown: 'Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only', }, required: false, jsonSerialized: false, @@ -3306,7 +3328,7 @@ const sendLocation: ApiMethod = { type: 'int32', }, description: { - markdown: 'Unique identifier for the target message thread (topic) of the forum; for forum supergroups only', + markdown: 'Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only', }, required: false, jsonSerialized: false, @@ -3534,7 +3556,7 @@ const sendVenue: ApiMethod = { type: 'int32', }, description: { - markdown: 'Unique identifier for the target message thread (topic) of the forum; for forum supergroups only', + markdown: 'Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only', }, required: false, jsonSerialized: false, @@ -3784,7 +3806,7 @@ const sendContact: ApiMethod = { type: 'int32', }, description: { - markdown: 'Unique identifier for the target message thread (topic) of the forum; for forum supergroups only', + markdown: 'Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only', }, required: false, jsonSerialized: false, @@ -3990,7 +4012,7 @@ const sendPoll: ApiMethod = { type: 'int32', }, description: { - markdown: 'Unique identifier for the target message thread (topic) of the forum; for forum supergroups only', + markdown: 'Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only', }, required: false, jsonSerialized: false, @@ -4399,7 +4421,7 @@ const sendDice: ApiMethod = { type: 'int32', }, description: { - markdown: 'Unique identifier for the target message thread (topic) of the forum; for forum supergroups only', + markdown: 'Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only', }, required: false, jsonSerialized: false, @@ -4530,6 +4552,89 @@ const sendDice: ApiMethod = { }, } +const sendMessageDraft: ApiMethod = { + name: 'sendMessageDraft', + description: { + markdown: 'Use this method to stream a partial message to a user while the message is being generated; supported only for bots with forum topic mode enabled. Returns _True_ on success.', + }, + parameters: [ + { + name: 'chat_id', + type: { + type: 'int32', + }, + description: { + markdown: 'Unique identifier for the target private chat', + }, + required: true, + jsonSerialized: false, + }, + { + name: 'message_thread_id', + type: { + type: 'int32', + }, + description: { + markdown: 'Unique identifier for the target message thread', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'draft_id', + type: { + type: 'int32', + }, + description: { + markdown: 'Unique identifier of the message draft; must be non-zero. Changes of drafts with the same identifier are animated', + }, + required: true, + jsonSerialized: false, + }, + { + name: 'text', + type: { + type: 'str', + }, + description: { + markdown: 'Text of the message to be sent, 1-4096 characters after entities parsing', + }, + required: true, + jsonSerialized: false, + }, + { + name: 'parse_mode', + type: { + type: 'str', + }, + description: { + markdown: 'Mode for parsing entities in the message text. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details.', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'entities', + type: { + type: 'array', + of: { + type: 'api-type', + name: 'MessageEntity', + }, + }, + description: { + markdown: 'An array of special entities that appear in message text, which can be specified instead of _parse\\_mode_', + }, + required: false, + jsonSerialized: true, + }, + ], + returnType: { + type: 'bool', + literal: true, + }, +} + const sendChatAction: ApiMethod = { name: 'sendChatAction', description: { @@ -4572,7 +4677,7 @@ const sendChatAction: ApiMethod = { type: 'int32', }, description: { - markdown: 'Unique identifier for the target message thread; for supergroups only', + markdown: 'Unique identifier for the target message thread or topic of a forum; for supergroups and private chats of bots with forum topic mode enabled only', }, required: false, jsonSerialized: false, @@ -5062,7 +5167,7 @@ const promoteChatMember: ApiMethod = { type: 'bool', }, description: { - markdown: 'Pass _True_ if the administrator can restrict, ban or unban chat members, or access supergroup statistics', + markdown: 'Pass _True_ if the administrator can restrict, ban or unban chat members, or access supergroup statistics. For backward compatibility, defaults to _True_ for promotions of channel administrators', }, required: false, jsonSerialized: false, @@ -6475,7 +6580,7 @@ const createForumTopic: ApiMethod = { const editForumTopic: ApiMethod = { name: 'editForumTopic', description: { - markdown: 'Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the _can\\_manage\\_topics_ administrator rights, unless it is the creator of the topic. Returns _True_ on success.', + markdown: 'Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the _can\\_manage\\_topics_ administrator rights, unless it is the creator of the topic. Returns _True_ on success.', }, parameters: [ { @@ -6626,7 +6731,7 @@ const reopenForumTopic: ApiMethod = { const deleteForumTopic: ApiMethod = { name: 'deleteForumTopic', description: { - markdown: 'Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the _can\\_delete\\_messages_ administrator rights. Returns _True_ on success.', + markdown: 'Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the _can\\_delete\\_messages_ administrator rights. Returns _True_ on success.', }, parameters: [ { @@ -6669,7 +6774,7 @@ const deleteForumTopic: ApiMethod = { const unpinAllForumTopicMessages: ApiMethod = { name: 'unpinAllForumTopicMessages', description: { - markdown: 'Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the _can\\_pin\\_messages_ administrator right in the supergroup. Returns _True_ on success.', + markdown: 'Use this method to clear the list of pinned messages in a forum topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the _can\\_pin\\_messages_ administrator right in the supergroup. Returns _True_ on success.', }, parameters: [ { @@ -7524,7 +7629,7 @@ const sendGift: ApiMethod = { type: 'str', }, description: { - markdown: 'Identifier of the gift', + markdown: 'Identifier of the gift; limited gifts can\'t be sent to channel chats', }, required: true, jsonSerialized: false, @@ -8240,12 +8345,23 @@ const getBusinessAccountGifts: ApiMethod = { jsonSerialized: false, }, { - name: 'exclude_limited', + name: 'exclude_limited_upgradable', + type: { + type: 'bool', + }, + description: { + markdown: 'Pass _True_ to exclude gifts that can be purchased a limited number of times and can be upgraded to unique', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'exclude_limited_non_upgradable', type: { type: 'bool', }, description: { - markdown: 'Pass _True_ to exclude gifts that can be purchased a limited number of times', + markdown: 'Pass _True_ to exclude gifts that can be purchased a limited number of times and can\'t be upgraded to unique', }, required: false, jsonSerialized: false, @@ -8261,6 +8377,17 @@ const getBusinessAccountGifts: ApiMethod = { required: false, jsonSerialized: false, }, + { + name: 'exclude_from_blockchain', + type: { + type: 'bool', + }, + description: { + markdown: 'Pass _True_ to exclude gifts that were assigned from the TON blockchain and can\'t be resold or transferred in Telegram', + }, + required: false, + jsonSerialized: false, + }, { name: 'sort_by_price', type: { @@ -8301,6 +8428,260 @@ const getBusinessAccountGifts: ApiMethod = { }, } +const getUserGifts: ApiMethod = { + name: 'getUserGifts', + description: { + markdown: 'Returns the gifts owned and hosted by a user. Returns [OwnedGifts](https://core.telegram.org/bots/api#ownedgifts) on success.', + }, + parameters: [ + { + name: 'user_id', + type: { + type: 'int32', + }, + description: { + markdown: 'Unique identifier of the user', + }, + required: true, + jsonSerialized: false, + }, + { + name: 'exclude_unlimited', + type: { + type: 'bool', + }, + description: { + markdown: 'Pass _True_ to exclude gifts that can be purchased an unlimited number of times', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'exclude_limited_upgradable', + type: { + type: 'bool', + }, + description: { + markdown: 'Pass _True_ to exclude gifts that can be purchased a limited number of times and can be upgraded to unique', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'exclude_limited_non_upgradable', + type: { + type: 'bool', + }, + description: { + markdown: 'Pass _True_ to exclude gifts that can be purchased a limited number of times and can\'t be upgraded to unique', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'exclude_from_blockchain', + type: { + type: 'bool', + }, + description: { + markdown: 'Pass _True_ to exclude gifts that were assigned from the TON blockchain and can\'t be resold or transferred in Telegram', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'exclude_unique', + type: { + type: 'bool', + }, + description: { + markdown: 'Pass _True_ to exclude unique gifts', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'sort_by_price', + type: { + type: 'bool', + }, + description: { + markdown: 'Pass _True_ to sort results by gift price instead of send date. Sorting is applied before pagination.', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'offset', + type: { + type: 'str', + }, + description: { + markdown: 'Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'limit', + type: { + type: 'int32', + }, + description: { + markdown: 'The maximum number of gifts to be returned; 1-100. Defaults to 100', + }, + required: false, + jsonSerialized: false, + }, + ], + returnType: { + type: 'api-type', + name: 'OwnedGifts', + }, +} + +const getChatGifts: ApiMethod = { + name: 'getChatGifts', + description: { + markdown: 'Returns the gifts owned by a chat. Returns [OwnedGifts](https://core.telegram.org/bots/api#ownedgifts) on success.', + }, + parameters: [ + { + name: 'chat_id', + type: { + type: 'union', + types: [ + { + type: 'int32', + }, + { + type: 'str', + }, + ], + }, + description: { + markdown: 'Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)', + }, + required: true, + jsonSerialized: false, + }, + { + name: 'exclude_unsaved', + type: { + type: 'bool', + }, + description: { + markdown: 'Pass _True_ to exclude gifts that aren\'t saved to the chat\'s profile page. Always _True_, unless the bot has the _can\\_post\\_messages_ administrator right in the channel.', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'exclude_saved', + type: { + type: 'bool', + }, + description: { + markdown: 'Pass _True_ to exclude gifts that are saved to the chat\'s profile page. Always _False_, unless the bot has the _can\\_post\\_messages_ administrator right in the channel.', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'exclude_unlimited', + type: { + type: 'bool', + }, + description: { + markdown: 'Pass _True_ to exclude gifts that can be purchased an unlimited number of times', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'exclude_limited_upgradable', + type: { + type: 'bool', + }, + description: { + markdown: 'Pass _True_ to exclude gifts that can be purchased a limited number of times and can be upgraded to unique', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'exclude_limited_non_upgradable', + type: { + type: 'bool', + }, + description: { + markdown: 'Pass _True_ to exclude gifts that can be purchased a limited number of times and can\'t be upgraded to unique', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'exclude_from_blockchain', + type: { + type: 'bool', + }, + description: { + markdown: 'Pass _True_ to exclude gifts that were assigned from the TON blockchain and can\'t be resold or transferred in Telegram', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'exclude_unique', + type: { + type: 'bool', + }, + description: { + markdown: 'Pass _True_ to exclude unique gifts', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'sort_by_price', + type: { + type: 'bool', + }, + description: { + markdown: 'Pass _True_ to sort results by gift price instead of send date. Sorting is applied before pagination.', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'offset', + type: { + type: 'str', + }, + description: { + markdown: 'Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'limit', + type: { + type: 'int32', + }, + description: { + markdown: 'The maximum number of gifts to be returned; 1-100. Defaults to 100', + }, + required: false, + jsonSerialized: false, + }, + ], + returnType: { + type: 'api-type', + name: 'OwnedGifts', + }, +} + const convertGiftToStars: ApiMethod = { name: 'convertGiftToStars', description: { @@ -8571,6 +8952,85 @@ const postStory: ApiMethod = { }, } +const repostStory: ApiMethod = { + name: 'repostStory', + description: { + markdown: 'Reposts a story on behalf of a business account from another business account. Both business accounts must be managed by the same bot, and the story on the source account must have been posted (or reposted) by the bot. Requires the _can\\_manage\\_stories_ business bot right for both business accounts. Returns [Story](https://core.telegram.org/bots/api#story) on success.', + }, + parameters: [ + { + name: 'business_connection_id', + type: { + type: 'str', + }, + description: { + markdown: 'Unique identifier of the business connection', + }, + required: true, + jsonSerialized: false, + }, + { + name: 'from_chat_id', + type: { + type: 'int32', + }, + description: { + markdown: 'Unique identifier of the chat which posted the story that should be reposted', + }, + required: true, + jsonSerialized: false, + }, + { + name: 'from_story_id', + type: { + type: 'int32', + }, + description: { + markdown: 'Unique identifier of the story that should be reposted', + }, + required: true, + jsonSerialized: false, + }, + { + name: 'active_period', + type: { + type: 'int32', + }, + description: { + markdown: 'Period after which the story is moved to the archive, in seconds; must be one of `6 * 3600`, `12 * 3600`, `86400`, or `2 * 86400`', + }, + required: true, + jsonSerialized: false, + }, + { + name: 'post_to_chat_page', + type: { + type: 'bool', + }, + description: { + markdown: 'Pass _True_ to keep the story accessible after it expires', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'protect_content', + type: { + type: 'bool', + }, + description: { + markdown: 'Pass _True_ if the content of the story must be protected from forwarding and screenshotting', + }, + required: false, + jsonSerialized: false, + }, + ], + returnType: { + type: 'api-type', + name: 'Story', + }, +} + const editStory: ApiMethod = { name: 'editStory', description: { @@ -9755,7 +10215,7 @@ const sendSticker: ApiMethod = { type: 'int32', }, description: { - markdown: 'Unique identifier for the target message thread (topic) of the forum; for forum supergroups only', + markdown: 'Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only', }, required: false, jsonSerialized: false, @@ -10754,7 +11214,7 @@ const sendInvoice: ApiMethod = { type: 'int32', }, description: { - markdown: 'Unique identifier for the target message thread (topic) of the forum; for forum supergroups only', + markdown: 'Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only', }, required: false, jsonSerialized: false, @@ -11664,7 +12124,7 @@ const sendGame: ApiMethod = { type: 'int32', }, description: { - markdown: 'Unique identifier for the target message thread (topic) of the forum; for forum supergroups only', + markdown: 'Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only', }, required: false, jsonSerialized: false, @@ -11946,6 +12406,7 @@ export const methods = { sendPoll, sendChecklist, sendDice, + sendMessageDraft, sendChatAction, setMessageReaction, getUserProfilePhotos, @@ -12028,10 +12489,13 @@ export const methods = { getBusinessAccountStarBalance, transferBusinessAccountStars, getBusinessAccountGifts, + getUserGifts, + getChatGifts, convertGiftToStars, upgradeGift, transferGift, postStory, + repostStory, editStory, deleteStory, editMessageText, diff --git a/src/bot-api/types.gen.ts b/src/bot-api/types.gen.ts index 0cb1bdb..348e2d4 100644 --- a/src/bot-api/types.gen.ts +++ b/src/bot-api/types.gen.ts @@ -568,6 +568,17 @@ const User = t({ required: false, jsonSerialized: false, }, + { + name: 'has_topics_enabled', + type: { + type: 'bool', + }, + description: { + markdown: '_True_, if the bot has forum topic mode enabled in private chats. Returned only in [getMe](https://core.telegram.org/bots/api#getme).', + }, + required: false, + jsonSerialized: false, + }, ], }) @@ -1223,6 +1234,41 @@ const ChatFullInfo = t({ required: false, jsonSerialized: false, }, + { + name: 'rating', + type: { + type: 'api-type', + name: 'UserRating', + }, + description: { + markdown: 'For private chats, the rating of the user if any', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'unique_gift_colors', + type: { + type: 'api-type', + name: 'UniqueGiftColors', + }, + description: { + markdown: 'The color scheme based on a unique gift that must be used for the chat\'s name, message replies and link previews', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'paid_message_star_count', + type: { + type: 'int32', + }, + description: { + markdown: 'The number of Telegram Stars a general user have to pay to send a message to the chat', + }, + required: false, + jsonSerialized: false, + }, ], }) @@ -1249,7 +1295,7 @@ const Message = t({ type: 'int32', }, description: { - markdown: 'Unique identifier of a message thread to which the message belongs; for supergroups only', + markdown: 'Unique identifier of a message thread or forum topic to which the message belongs; for supergroups and private chats only', }, required: false, jsonSerialized: false, @@ -1366,7 +1412,7 @@ const Message = t({ literal: true, }, description: { - markdown: '_True_, if the message is sent to a forum topic', + markdown: '_True_, if the message is sent to a topic in a forum supergroup or a private chat with the bot', }, required: false, jsonSerialized: false, @@ -2083,6 +2129,18 @@ const Message = t({ required: false, jsonSerialized: false, }, + { + name: 'gift_upgrade_sent', + type: { + type: 'api-type', + name: 'GiftInfo', + }, + description: { + markdown: 'Service message: upgrade of a gift was purchased after the gift was sent', + }, + required: false, + jsonSerialized: false, + }, { name: 'connected_website', type: { @@ -4642,7 +4700,19 @@ const ChecklistTask = t({ name: 'User', }, description: { - markdown: 'User that completed the task; omitted if the task wasn\'t completed', + markdown: 'User that completed the task; omitted if the task wasn\'t completed by a user', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'completed_by_chat', + type: { + type: 'api-type', + name: 'Chat', + }, + description: { + markdown: 'Chat that completed the task; omitted if the task wasn\'t completed by a chat', }, required: false, jsonSerialized: false, @@ -5681,6 +5751,18 @@ const ForumTopicCreated = t({ required: false, jsonSerialized: false, }, + { + name: 'is_name_implicit', + type: { + type: 'bool', + literal: true, + }, + description: { + markdown: '_True_, if the name of the topic wasn\'t specified explicitly by its creator and likely needs to be changed by the bot', + }, + required: false, + jsonSerialized: false, + }, ], }) @@ -9342,6 +9424,59 @@ const BusinessOpeningHours = t({ ], }) +const UserRating = t({ + name: 'UserRating', + description: { + markdown: 'This object describes the rating of a user based on their Telegram Star spendings.', + }, + fields: [ + { + name: 'level', + type: { + type: 'int32', + }, + description: { + markdown: 'Current level of the user, indicating their reliability when purchasing digital goods and services. A higher level suggests a more trustworthy customer; a negative level is likely reason for concern.', + }, + required: true, + jsonSerialized: false, + }, + { + name: 'rating', + type: { + type: 'int32', + }, + description: { + markdown: 'Numerical value of the user\'s rating; the higher the rating, the better', + }, + required: true, + jsonSerialized: false, + }, + { + name: 'current_level_rating', + type: { + type: 'int32', + }, + description: { + markdown: 'The rating value required to get the current level', + }, + required: true, + jsonSerialized: false, + }, + { + name: 'next_level_rating', + type: { + type: 'int32', + }, + description: { + markdown: 'The rating value required to get to the next level; omitted if the maximum level was reached', + }, + required: false, + jsonSerialized: false, + }, + ], +}) + const StoryAreaPosition = t({ name: 'StoryAreaPosition', description: { @@ -10127,6 +10262,60 @@ const ForumTopic = t({ required: false, jsonSerialized: false, }, + { + name: 'is_name_implicit', + type: { + type: 'bool', + literal: true, + }, + description: { + markdown: '_True_, if the name of the topic wasn\'t specified explicitly by its creator and likely needs to be changed by the bot', + }, + required: false, + jsonSerialized: false, + }, + ], +}) + +const GiftBackground = t({ + name: 'GiftBackground', + description: { + markdown: 'This object describes the background of a gift.', + }, + fields: [ + { + name: 'center_color', + type: { + type: 'int32', + }, + description: { + markdown: 'Center color of the background in RGB format', + }, + required: true, + jsonSerialized: false, + }, + { + name: 'edge_color', + type: { + type: 'int32', + }, + description: { + markdown: 'Edge color of the background in RGB format', + }, + required: true, + jsonSerialized: false, + }, + { + name: 'text_color', + type: { + type: 'int32', + }, + description: { + markdown: 'Text color of the background in RGB format', + }, + required: true, + jsonSerialized: false, + }, ], }) @@ -10181,13 +10370,37 @@ const Gift = t({ required: false, jsonSerialized: false, }, + { + name: 'is_premium', + type: { + type: 'bool', + literal: true, + }, + description: { + markdown: '_True_, if the gift can only be purchased by Telegram Premium subscribers', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'has_colors', + type: { + type: 'bool', + literal: true, + }, + description: { + markdown: '_True_, if the gift can be used (after being upgraded) to customize a user\'s appearance', + }, + required: false, + jsonSerialized: false, + }, { name: 'total_count', type: { type: 'int32', }, description: { - markdown: 'The total number of the gifts of this type that can be sent; for limited gifts only', + markdown: 'The total number of gifts of this type that can be sent by all users; for limited gifts only', }, required: false, jsonSerialized: false, @@ -10198,7 +10411,52 @@ const Gift = t({ type: 'int32', }, description: { - markdown: 'The number of remaining gifts of this type that can be sent; for limited gifts only', + markdown: 'The number of remaining gifts of this type that can be sent by all users; for limited gifts only', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'personal_total_count', + type: { + type: 'int32', + }, + description: { + markdown: 'The total number of gifts of this type that can be sent by the bot; for limited gifts only', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'personal_remaining_count', + type: { + type: 'int32', + }, + description: { + markdown: 'The number of remaining gifts of this type that can be sent by the bot; for limited gifts only', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'background', + type: { + type: 'api-type', + name: 'GiftBackground', + }, + description: { + markdown: 'Background of the gift', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'unique_gift_variant_count', + type: { + type: 'int32', + }, + description: { + markdown: 'The total number of different unique gifts that can be obtained by upgrading the gift', }, required: false, jsonSerialized: false, @@ -10424,12 +10682,104 @@ const UniqueGiftBackdrop = t({ ], }) +const UniqueGiftColors = t({ + name: 'UniqueGiftColors', + description: { + markdown: 'This object contains information about the color scheme for a user\'s name, message replies and link previews based on a unique gift.', + }, + fields: [ + { + name: 'model_custom_emoji_id', + type: { + type: 'str', + }, + description: { + markdown: 'Custom emoji identifier of the unique gift\'s model', + }, + required: true, + jsonSerialized: false, + }, + { + name: 'symbol_custom_emoji_id', + type: { + type: 'str', + }, + description: { + markdown: 'Custom emoji identifier of the unique gift\'s symbol', + }, + required: true, + jsonSerialized: false, + }, + { + name: 'light_theme_main_color', + type: { + type: 'int32', + }, + description: { + markdown: 'Main color used in light themes; RGB format', + }, + required: true, + jsonSerialized: false, + }, + { + name: 'light_theme_other_colors', + type: { + type: 'array', + of: { + type: 'int32', + }, + }, + description: { + markdown: 'List of 1-3 additional colors used in light themes; RGB format', + }, + required: true, + jsonSerialized: false, + }, + { + name: 'dark_theme_main_color', + type: { + type: 'int32', + }, + description: { + markdown: 'Main color used in dark themes; RGB format', + }, + required: true, + jsonSerialized: false, + }, + { + name: 'dark_theme_other_colors', + type: { + type: 'array', + of: { + type: 'int32', + }, + }, + description: { + markdown: 'List of 1-3 additional colors used in dark themes; RGB format', + }, + required: true, + jsonSerialized: false, + }, + ], +}) + const UniqueGift = t({ name: 'UniqueGift', description: { markdown: 'This object describes a unique gift that was upgraded from a regular gift.', }, fields: [ + { + name: 'gift_id', + type: { + type: 'str', + }, + description: { + markdown: 'Identifier of the regular gift from which the gift was upgraded', + }, + required: true, + jsonSerialized: false, + }, { name: 'base_name', type: { @@ -10499,6 +10849,42 @@ const UniqueGift = t({ required: true, jsonSerialized: false, }, + { + name: 'is_premium', + type: { + type: 'bool', + literal: true, + }, + description: { + markdown: '_True_, if the original regular gift was exclusively purchaseable by Telegram Premium subscribers', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'is_from_blockchain', + type: { + type: 'bool', + literal: true, + }, + description: { + markdown: '_True_, if the gift is assigned from the TON blockchain and can\'t be resold or transferred in Telegram', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'colors', + type: { + type: 'api-type', + name: 'UniqueGiftColors', + }, + description: { + markdown: 'The color scheme that can be used by the gift\'s owner for the chat\'s name, replies to messages and link previews; for business account gifts and gifts that are currently on sale only', + }, + required: false, + jsonSerialized: false, + }, { name: 'publisher_chat', type: { @@ -10560,7 +10946,19 @@ const GiftInfo = t({ type: 'int32', }, description: { - markdown: 'Number of Telegram Stars that were prepaid by the sender for the ability to upgrade the gift', + markdown: 'Number of Telegram Stars that were prepaid for the ability to upgrade the gift', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'is_upgrade_separate', + type: { + type: 'bool', + literal: true, + }, + description: { + markdown: '_True_, if the gift\'s upgrade was purchased after the gift was sent', }, required: false, jsonSerialized: false, @@ -10615,6 +11013,17 @@ const GiftInfo = t({ required: false, jsonSerialized: false, }, + { + name: 'unique_gift_number', + type: { + type: 'int32', + }, + description: { + markdown: 'Unique number reserved for this gift when upgraded. See the _number_ field in [UniqueGift](https://core.telegram.org/bots/api#uniquegift)', + }, + required: false, + jsonSerialized: false, + }, ], }) @@ -10642,18 +11051,29 @@ const UniqueGiftInfo = t({ type: 'str', }, description: { - markdown: 'Origin of the gift. Currently, either “upgrade” for gifts upgraded from regular gifts, “transfer” for gifts transferred from other users or channels, or “resale” for gifts bought from other users', + markdown: 'Origin of the gift. Currently, either “upgrade” for gifts upgraded from regular gifts, “transfer” for gifts transferred from other users or channels, “resale” for gifts bought from other users, “gifted\\_upgrade” for upgrades purchased after the gift was sent, or “offer” for gifts bought or sold through gift purchase offers', }, required: true, jsonSerialized: false, }, { - name: 'last_resale_star_count', + name: 'last_resale_currency', + type: { + type: 'str', + }, + description: { + markdown: 'For gifts bought from other users, the currency in which the payment for the gift was done. Currently, one of “XTR” for Telegram Stars or “TON” for toncoins.', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'last_resale_amount', type: { type: 'int32', }, description: { - markdown: 'For gifts bought from other users, the price paid for the gift', + markdown: 'For gifts bought from other users, the price paid for the gift in either Telegram Stars or nanotoncoins', }, required: false, jsonSerialized: false, @@ -10854,7 +11274,7 @@ const OwnedGiftRegular = t({ type: 'int32', }, description: { - markdown: 'Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars', + markdown: 'Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars; for gifts received on behalf of business accounts only', }, required: false, jsonSerialized: false, @@ -10865,7 +11285,30 @@ const OwnedGiftRegular = t({ type: 'int32', }, description: { - markdown: 'Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift', + markdown: 'Number of Telegram Stars that were paid for the ability to upgrade the gift', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'is_upgrade_separate', + type: { + type: 'bool', + literal: true, + }, + description: { + markdown: '_True_, if the gift\'s upgrade was purchased after the gift was sent; for gifts received on behalf of business accounts only', + }, + required: false, + jsonSerialized: false, + }, + { + name: 'unique_gift_number', + type: { + type: 'int32', + }, + description: { + markdown: 'Unique number reserved for this gift when upgraded. See the _number_ field in [UniqueGift](https://core.telegram.org/bots/api#uniquegift)', }, required: false, jsonSerialized: false, @@ -11081,6 +11524,17 @@ const AcceptedGiftTypes = t({ required: true, jsonSerialized: false, }, + { + name: 'gifts_from_channels', + type: { + type: 'bool', + }, + description: { + markdown: '_True_, if transfers of unique gifts from channels are accepted', + }, + required: true, + jsonSerialized: false, + }, ], }) @@ -19473,6 +19927,7 @@ export const types = { BusinessLocation, BusinessOpeningHoursInterval, BusinessOpeningHours, + UserRating, StoryAreaPosition, LocationAddress, StoryAreaType, @@ -19491,12 +19946,14 @@ export const types = { MessageReactionUpdated, MessageReactionCountUpdated, ForumTopic, + GiftBackground, Gift, Gifts, UniqueGiftModel, UniqueGiftSymbol, UniqueGiftBackdropColors, UniqueGiftBackdrop, + UniqueGiftColors, UniqueGift, GiftInfo, UniqueGiftInfo,