Added full support for the Bot API 9.0 (#1671)

* Added full support for the Bot API 9.0

* Bump version
This commit is contained in:
Alex Root Junior 2025-04-12 23:29:48 +03:00 committed by GitHub
parent 25e9127db9
commit 2c2bd61551
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
231 changed files with 9565 additions and 389 deletions

View file

@ -1 +1 @@
8.3 9.0

View file

@ -43,3 +43,4 @@ extract:
- has_media_spoiler - has_media_spoiler
- effect_id - effect_id
- show_caption_above_media - show_caption_above_media
- paid_star_count

View file

@ -0,0 +1,11 @@
name: InputProfilePhotoType
description: |
This object represents input profile photo type
Source: https://core.telegram.org/bots/api#inputprofilephoto
multi_parse:
attribute: type
regexp: "must be '([a-z_]+)'"
entities:
- InputProfilePhotoStatic
- InputProfilePhotoAnimated

View file

@ -0,0 +1,11 @@
name: InputStoryContentType
description: |
This object represents input story content photo type.
Source: https://core.telegram.org/bots/api#inputstorycontentphoto
multi_parse:
attribute: type
regexp: "must be '([a-z_]+)'"
entities:
- InputStoryContentPhoto
- InputStoryContentVideo

View file

@ -0,0 +1,11 @@
name: OwnedGiftType
description: |
This object represents owned gift type
Source: https://core.telegram.org/bots/api#ownedgift
multi_parse:
attribute: type
regexp: "'([a-z_]+)'"
entities:
- OwnedGiftRegular
- OwnedGiftUnique

View file

@ -0,0 +1,14 @@
name: StoryAreaTypeType
description: |
This object represents input profile photo type
Source: https://core.telegram.org/bots/api#storyareatype
multi_parse:
attribute: type
regexp: "'([a-z_]+)'"
entities:
- StoryAreaTypeLocation
- StoryAreaTypeSuggestedReaction
- StoryAreaTypeLink
- StoryAreaTypeWeather
- StoryAreaTypeUniqueGift

View file

@ -0,0 +1,10 @@
name: TransactionPartnerUserTransactionTypeEnum
description: |
This object represents type of the transaction that were made by partner user.
Source: https://core.telegram.org/bots/api#transactionpartneruser
parse:
entity: TransactionPartnerUser
category: types
attribute: transaction_type
regexp: "'([a-z_]+)'"

View file

@ -0,0 +1,33 @@
{
"meta": {},
"group": {
"title": "Updating messages",
"anchor": "updating-messages"
},
"object": {
"anchor": "convertgifttostars",
"name": "convertGiftToStars",
"description": "Converts a given regular gift to Telegram Stars. Requires the can_convert_gifts_to_stars business bot right. Returns True on success.",
"html_description": "<p>Converts a given regular gift to Telegram Stars. Requires the <em>can_convert_gifts_to_stars</em> business bot right. Returns <em>True</em> on success.</p>",
"rst_description": "Converts a given regular gift to Telegram Stars. Requires the *can_convert_gifts_to_stars* business bot right. Returns :code:`True` on success.",
"annotations": [
{
"type": "String",
"required": true,
"description": "Unique identifier of the business connection",
"html_description": "<td>Unique identifier of the business connection</td>",
"rst_description": "Unique identifier of the business connection\n",
"name": "business_connection_id"
},
{
"type": "String",
"required": true,
"description": "Unique identifier of the regular gift that should be converted to Telegram Stars",
"html_description": "<td>Unique identifier of the regular gift that should be converted to Telegram Stars</td>",
"rst_description": "Unique identifier of the regular gift that should be converted to Telegram Stars\n",
"name": "owned_gift_id"
}
],
"category": "methods"
}
}

View file

@ -38,9 +38,9 @@
{ {
"type": "Integer", "type": "Integer",
"required": true, "required": true,
"description": "The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500", "description": "The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-10000",
"html_description": "<td>The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500</td>", "html_description": "<td>The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-10000</td>",
"rst_description": "The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500\n", "rst_description": "The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-10000\n",
"name": "subscription_price" "name": "subscription_price"
} }
], ],

View file

@ -70,9 +70,9 @@
{ {
"type": "Integer", "type": "Integer",
"required": false, "required": false,
"description": "The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 2500 Telegram Stars.", "description": "The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 10000 Telegram Stars.",
"html_description": "<td>The number of seconds the subscription will be active for before the next payment. The currency must be set to &#8220;XTR&#8221; (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 2500 Telegram Stars.</td>", "html_description": "<td>The number of seconds the subscription will be active for before the next payment. The currency must be set to &#8220;XTR&#8221; (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 10000 Telegram Stars.</td>",
"rst_description": "The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 2500 Telegram Stars.\n", "rst_description": "The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 10000 Telegram Stars.\n",
"name": "subscription_period" "name": "subscription_period"
}, },
{ {

View file

@ -0,0 +1,33 @@
{
"meta": {},
"group": {
"title": "Updating messages",
"anchor": "updating-messages"
},
"object": {
"anchor": "deletebusinessmessages",
"name": "deleteBusinessMessages",
"description": "Delete messages on behalf of a business account. Requires the can_delete_outgoing_messages business bot right to delete messages sent by the bot itself, or the can_delete_all_messages business bot right to delete any message. Returns True on success.",
"html_description": "<p>Delete messages on behalf of a business account. Requires the <em>can_delete_outgoing_messages</em> business bot right to delete messages sent by the bot itself, or the <em>can_delete_all_messages</em> business bot right to delete any message. Returns <em>True</em> on success.</p>",
"rst_description": "Delete messages on behalf of a business account. Requires the *can_delete_outgoing_messages* business bot right to delete messages sent by the bot itself, or the *can_delete_all_messages* business bot right to delete any message. Returns :code:`True` on success.",
"annotations": [
{
"type": "String",
"required": true,
"description": "Unique identifier of the business connection on behalf of which to delete the messages",
"html_description": "<td>Unique identifier of the business connection on behalf of which to delete the messages</td>",
"rst_description": "Unique identifier of the business connection on behalf of which to delete the messages\n",
"name": "business_connection_id"
},
{
"type": "Array of Integer",
"required": true,
"description": "A JSON-serialized list of 1-100 identifiers of messages to delete. All messages must be from the same chat. See deleteMessage for limitations on which messages can be deleted",
"html_description": "<td>A JSON-serialized list of 1-100 identifiers of messages to delete. All messages must be from the same chat. See <a href=\"#deletemessage\">deleteMessage</a> for limitations on which messages can be deleted</td>",
"rst_description": "A JSON-serialized list of 1-100 identifiers of messages to delete. All messages must be from the same chat. See :class:`aiogram.methods.delete_message.DeleteMessage` for limitations on which messages can be deleted\n",
"name": "message_ids"
}
],
"category": "methods"
}
}

View file

@ -0,0 +1,33 @@
{
"meta": {},
"group": {
"title": "Updating messages",
"anchor": "updating-messages"
},
"object": {
"anchor": "deletestory",
"name": "deleteStory",
"description": "Deletes a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns True on success.",
"html_description": "<p>Deletes a story previously posted by the bot on behalf of a managed business account. Requires the <em>can_manage_stories</em> business bot right. Returns <em>True</em> on success.</p>",
"rst_description": "Deletes a story previously posted by the bot on behalf of a managed business account. Requires the *can_manage_stories* business bot right. Returns :code:`True` on success.",
"annotations": [
{
"type": "String",
"required": true,
"description": "Unique identifier of the business connection",
"html_description": "<td>Unique identifier of the business connection</td>",
"rst_description": "Unique identifier of the business connection\n",
"name": "business_connection_id"
},
{
"type": "Integer",
"required": true,
"description": "Unique identifier of the story to delete",
"html_description": "<td>Unique identifier of the story to delete</td>",
"rst_description": "Unique identifier of the story to delete\n",
"name": "story_id"
}
],
"category": "methods"
}
}

View file

@ -0,0 +1,73 @@
{
"meta": {},
"group": {
"title": "Updating messages",
"anchor": "updating-messages"
},
"object": {
"anchor": "editstory",
"name": "editStory",
"description": "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 on success.",
"html_description": "<p>Edits a story previously posted by the bot on behalf of a managed business account. Requires the <em>can_manage_stories</em> business bot right. Returns <a href=\"#story\">Story</a> on success.</p>",
"rst_description": "Edits a story previously posted by the bot on behalf of a managed business account. Requires the *can_manage_stories* business bot right. Returns :class:`aiogram.types.story.Story` on success.",
"annotations": [
{
"type": "String",
"required": true,
"description": "Unique identifier of the business connection",
"html_description": "<td>Unique identifier of the business connection</td>",
"rst_description": "Unique identifier of the business connection\n",
"name": "business_connection_id"
},
{
"type": "Integer",
"required": true,
"description": "Unique identifier of the story to edit",
"html_description": "<td>Unique identifier of the story to edit</td>",
"rst_description": "Unique identifier of the story to edit\n",
"name": "story_id"
},
{
"type": "InputStoryContent",
"required": true,
"description": "Content of the story",
"html_description": "<td>Content of the story</td>",
"rst_description": "Content of the story\n",
"name": "content"
},
{
"type": "String",
"required": false,
"description": "Caption of the story, 0-2048 characters after entities parsing",
"html_description": "<td>Caption of the story, 0-2048 characters after entities parsing</td>",
"rst_description": "Caption of the story, 0-2048 characters after entities parsing\n",
"name": "caption"
},
{
"type": "String",
"required": false,
"description": "Mode for parsing entities in the story caption. See formatting options for more details.",
"html_description": "<td>Mode for parsing entities in the story caption. See <a href=\"#formatting-options\">formatting options</a> for more details.</td>",
"rst_description": "Mode for parsing entities in the story caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.\n",
"name": "parse_mode"
},
{
"type": "Array of MessageEntity",
"required": false,
"description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode",
"html_description": "<td>A JSON-serialized list of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em></td>",
"rst_description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*\n",
"name": "caption_entities"
},
{
"type": "Array of StoryArea",
"required": false,
"description": "A JSON-serialized list of clickable areas to be shown on the story",
"html_description": "<td>A JSON-serialized list of clickable areas to be shown on the story</td>",
"rst_description": "A JSON-serialized list of clickable areas to be shown on the story\n",
"name": "areas"
}
],
"category": "methods"
}
}

View file

@ -1,8 +1,8 @@
{ {
"meta": {}, "meta": {},
"group": { "group": {
"title": "Stickers", "title": "Updating messages",
"anchor": "stickers" "anchor": "updating-messages"
}, },
"object": { "object": {
"anchor": "getavailablegifts", "anchor": "getavailablegifts",

View file

@ -0,0 +1,89 @@
{
"meta": {},
"group": {
"title": "Updating messages",
"anchor": "updating-messages"
},
"object": {
"anchor": "getbusinessaccountgifts",
"name": "getBusinessAccountGifts",
"description": "Returns the gifts received and owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns OwnedGifts on success.",
"html_description": "<p>Returns the gifts received and owned by a managed business account. Requires the <em>can_view_gifts_and_stars</em> business bot right. Returns <a href=\"#ownedgifts\">OwnedGifts</a> on success.</p>",
"rst_description": "Returns the gifts received and owned by a managed business account. Requires the *can_view_gifts_and_stars* business bot right. Returns :class:`aiogram.types.owned_gifts.OwnedGifts` on success.",
"annotations": [
{
"type": "String",
"required": true,
"description": "Unique identifier of the business connection",
"html_description": "<td>Unique identifier of the business connection</td>",
"rst_description": "Unique identifier of the business connection\n",
"name": "business_connection_id"
},
{
"type": "Boolean",
"required": false,
"description": "Pass True to exclude gifts that aren't saved to the account's profile page",
"html_description": "<td>Pass True to exclude gifts that aren't saved to the account's profile page</td>",
"rst_description": "Pass True to exclude gifts that aren't saved to the account's profile page\n",
"name": "exclude_unsaved"
},
{
"type": "Boolean",
"required": false,
"description": "Pass True to exclude gifts that are saved to the account's profile page",
"html_description": "<td>Pass True to exclude gifts that are saved to the account's profile page</td>",
"rst_description": "Pass True to exclude gifts that are saved to the account's profile page\n",
"name": "exclude_saved"
},
{
"type": "Boolean",
"required": false,
"description": "Pass True to exclude gifts that can be purchased an unlimited number of times",
"html_description": "<td>Pass True to exclude gifts that can be purchased an unlimited number of times</td>",
"rst_description": "Pass True to exclude gifts that can be purchased an unlimited number of times\n",
"name": "exclude_unlimited"
},
{
"type": "Boolean",
"required": false,
"description": "Pass True to exclude gifts that can be purchased a limited number of times",
"html_description": "<td>Pass True to exclude gifts that can be purchased a limited number of times</td>",
"rst_description": "Pass True to exclude gifts that can be purchased a limited number of times\n",
"name": "exclude_limited"
},
{
"type": "Boolean",
"required": false,
"description": "Pass True to exclude unique gifts",
"html_description": "<td>Pass True to exclude unique gifts</td>",
"rst_description": "Pass True to exclude unique gifts\n",
"name": "exclude_unique"
},
{
"type": "Boolean",
"required": false,
"description": "Pass True to sort results by gift price instead of send date. Sorting is applied before pagination.",
"html_description": "<td>Pass True to sort results by gift price instead of send date. Sorting is applied before pagination.</td>",
"rst_description": "Pass True to sort results by gift price instead of send date. Sorting is applied before pagination.\n",
"name": "sort_by_price"
},
{
"type": "String",
"required": false,
"description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results",
"html_description": "<td>Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results</td>",
"rst_description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results\n",
"name": "offset"
},
{
"type": "Integer",
"required": false,
"description": "The maximum number of gifts to be returned; 1-100. Defaults to 100",
"html_description": "<td>The maximum number of gifts to be returned; 1-100. Defaults to 100</td>",
"rst_description": "The maximum number of gifts to be returned; 1-100. Defaults to 100\n",
"name": "limit"
}
],
"category": "methods"
}
}

View file

@ -0,0 +1,25 @@
{
"meta": {},
"group": {
"title": "Updating messages",
"anchor": "updating-messages"
},
"object": {
"anchor": "getbusinessaccountstarbalance",
"name": "getBusinessAccountStarBalance",
"description": "Returns the amount of Telegram Stars owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns StarAmount on success.",
"html_description": "<p>Returns the amount of Telegram Stars owned by a managed business account. Requires the <em>can_view_gifts_and_stars</em> business bot right. Returns <a href=\"#staramount\">StarAmount</a> on success.</p>",
"rst_description": "Returns the amount of Telegram Stars owned by a managed business account. Requires the *can_view_gifts_and_stars* business bot right. Returns :class:`aiogram.types.star_amount.StarAmount` on success.",
"annotations": [
{
"type": "String",
"required": true,
"description": "Unique identifier of the business connection",
"html_description": "<td>Unique identifier of the business connection</td>",
"rst_description": "Unique identifier of the business connection\n",
"name": "business_connection_id"
}
],
"category": "methods"
}
}

View file

@ -0,0 +1,65 @@
{
"meta": {},
"group": {
"title": "Updating messages",
"anchor": "updating-messages"
},
"object": {
"anchor": "giftpremiumsubscription",
"name": "giftPremiumSubscription",
"description": "Gifts a Telegram Premium subscription to the given user. Returns True on success.",
"html_description": "<p>Gifts a Telegram Premium subscription to the given user. Returns <em>True</em> on success.</p>",
"rst_description": "Gifts a Telegram Premium subscription to the given user. Returns :code:`True` on success.",
"annotations": [
{
"type": "Integer",
"required": true,
"description": "Unique identifier of the target user who will receive a Telegram Premium subscription",
"html_description": "<td>Unique identifier of the target user who will receive a Telegram Premium subscription</td>",
"rst_description": "Unique identifier of the target user who will receive a Telegram Premium subscription\n",
"name": "user_id"
},
{
"type": "Integer",
"required": true,
"description": "Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12",
"html_description": "<td>Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12</td>",
"rst_description": "Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12\n",
"name": "month_count"
},
{
"type": "Integer",
"required": true,
"description": "Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months",
"html_description": "<td>Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months</td>",
"rst_description": "Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months\n",
"name": "star_count"
},
{
"type": "String",
"required": false,
"description": "Text that will be shown along with the service message about the subscription; 0-128 characters",
"html_description": "<td>Text that will be shown along with the service message about the subscription; 0-128 characters</td>",
"rst_description": "Text that will be shown along with the service message about the subscription; 0-128 characters\n",
"name": "text"
},
{
"type": "String",
"required": false,
"description": "Mode for parsing entities in the text. See formatting options for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.",
"html_description": "<td>Mode for parsing entities in the text. See <a href=\"#formatting-options\">formatting options</a> for more details. Entities other than &#8220;bold&#8221;, &#8220;italic&#8221;, &#8220;underline&#8221;, &#8220;strikethrough&#8221;, &#8220;spoiler&#8221;, and &#8220;custom_emoji&#8221; are ignored.</td>",
"rst_description": "Mode for parsing entities in the text. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.\n",
"name": "text_parse_mode"
},
{
"type": "Array of MessageEntity",
"required": false,
"description": "A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.",
"html_description": "<td>A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of <em>text_parse_mode</em>. Entities other than &#8220;bold&#8221;, &#8220;italic&#8221;, &#8220;underline&#8221;, &#8220;strikethrough&#8221;, &#8220;spoiler&#8221;, and &#8220;custom_emoji&#8221; are ignored.</td>",
"rst_description": "A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of *text_parse_mode*. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.\n",
"name": "text_entities"
}
],
"category": "methods"
}
}

View file

@ -0,0 +1,89 @@
{
"meta": {},
"group": {
"title": "Updating messages",
"anchor": "updating-messages"
},
"object": {
"anchor": "poststory",
"name": "postStory",
"description": "Posts a story on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success.",
"html_description": "<p>Posts a story on behalf of a managed business account. Requires the <em>can_manage_stories</em> business bot right. Returns <a href=\"#story\">Story</a> on success.</p>",
"rst_description": "Posts a story on behalf of a managed business account. Requires the *can_manage_stories* business bot right. Returns :class:`aiogram.types.story.Story` on success.",
"annotations": [
{
"type": "String",
"required": true,
"description": "Unique identifier of the business connection",
"html_description": "<td>Unique identifier of the business connection</td>",
"rst_description": "Unique identifier of the business connection\n",
"name": "business_connection_id"
},
{
"type": "InputStoryContent",
"required": true,
"description": "Content of the story",
"html_description": "<td>Content of the story</td>",
"rst_description": "Content of the story\n",
"name": "content"
},
{
"type": "Integer",
"required": true,
"description": "Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400",
"html_description": "<td>Period after which the story is moved to the archive, in seconds; must be one of <code>6 * 3600</code>, <code>12 * 3600</code>, <code>86400</code>, or <code>2 * 86400</code></td>",
"rst_description": "Period after which the story is moved to the archive, in seconds; must be one of :code:`6 * 3600`, :code:`12 * 3600`, :code:`86400`, or :code:`2 * 86400`\n",
"name": "active_period"
},
{
"type": "String",
"required": false,
"description": "Caption of the story, 0-2048 characters after entities parsing",
"html_description": "<td>Caption of the story, 0-2048 characters after entities parsing</td>",
"rst_description": "Caption of the story, 0-2048 characters after entities parsing\n",
"name": "caption"
},
{
"type": "String",
"required": false,
"description": "Mode for parsing entities in the story caption. See formatting options for more details.",
"html_description": "<td>Mode for parsing entities in the story caption. See <a href=\"#formatting-options\">formatting options</a> for more details.</td>",
"rst_description": "Mode for parsing entities in the story caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.\n",
"name": "parse_mode"
},
{
"type": "Array of MessageEntity",
"required": false,
"description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode",
"html_description": "<td>A JSON-serialized list of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em></td>",
"rst_description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*\n",
"name": "caption_entities"
},
{
"type": "Array of StoryArea",
"required": false,
"description": "A JSON-serialized list of clickable areas to be shown on the story",
"html_description": "<td>A JSON-serialized list of clickable areas to be shown on the story</td>",
"rst_description": "A JSON-serialized list of clickable areas to be shown on the story\n",
"name": "areas"
},
{
"type": "Boolean",
"required": false,
"description": "Pass True to keep the story accessible after it expires",
"html_description": "<td>Pass <em>True</em> to keep the story accessible after it expires</td>",
"rst_description": "Pass :code:`True` to keep the story accessible after it expires\n",
"name": "post_to_chat_page"
},
{
"type": "Boolean",
"required": false,
"description": "Pass True if the content of the story must be protected from forwarding and screenshotting",
"html_description": "<td>Pass <em>True</em> if the content of the story must be protected from forwarding and screenshotting</td>",
"rst_description": "Pass :code:`True` if the content of the story must be protected from forwarding and screenshotting\n",
"name": "protect_content"
}
],
"category": "methods"
}
}

View file

@ -0,0 +1,41 @@
{
"meta": {},
"group": {
"title": "Updating messages",
"anchor": "updating-messages"
},
"object": {
"anchor": "readbusinessmessage",
"name": "readBusinessMessage",
"description": "Marks incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success.",
"html_description": "<p>Marks incoming message as read on behalf of a business account. Requires the <em>can_read_messages</em> business bot right. Returns <em>True</em> on success.</p>",
"rst_description": "Marks incoming message as read on behalf of a business account. Requires the *can_read_messages* business bot right. Returns :code:`True` on success.",
"annotations": [
{
"type": "String",
"required": true,
"description": "Unique identifier of the business connection on behalf of which to read the message",
"html_description": "<td>Unique identifier of the business connection on behalf of which to read the message</td>",
"rst_description": "Unique identifier of the business connection on behalf of which to read the message\n",
"name": "business_connection_id"
},
{
"type": "Integer",
"required": true,
"description": "Unique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours.",
"html_description": "<td>Unique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours.</td>",
"rst_description": "Unique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours.\n",
"name": "chat_id"
},
{
"type": "Integer",
"required": true,
"description": "Unique identifier of the message to mark as read",
"html_description": "<td>Unique identifier of the message to mark as read</td>",
"rst_description": "Unique identifier of the message to mark as read\n",
"name": "message_id"
}
],
"category": "methods"
}
}

View file

@ -0,0 +1,33 @@
{
"meta": {},
"group": {
"title": "Updating messages",
"anchor": "updating-messages"
},
"object": {
"anchor": "removebusinessaccountprofilephoto",
"name": "removeBusinessAccountProfilePhoto",
"description": "Removes the current profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success.",
"html_description": "<p>Removes the current profile photo of a managed business account. Requires the <em>can_edit_profile_photo</em> business bot right. Returns <em>True</em> on success.</p>",
"rst_description": "Removes the current profile photo of a managed business account. Requires the *can_edit_profile_photo* business bot right. Returns :code:`True` on success.",
"annotations": [
{
"type": "String",
"required": true,
"description": "Unique identifier of the business connection",
"html_description": "<td>Unique identifier of the business connection</td>",
"rst_description": "Unique identifier of the business connection\n",
"name": "business_connection_id"
},
{
"type": "Boolean",
"required": false,
"description": "Pass True to remove the public photo, which is visible even if the main photo is hidden by the business account's privacy settings. After the main photo is removed, the previous profile photo (if present) becomes the main photo.",
"html_description": "<td>Pass True to remove the public photo, which is visible even if the main photo is hidden by the business account's privacy settings. After the main photo is removed, the previous profile photo (if present) becomes the main photo.</td>",
"rst_description": "Pass True to remove the public photo, which is visible even if the main photo is hidden by the business account's privacy settings. After the main photo is removed, the previous profile photo (if present) becomes the main photo.\n",
"name": "is_public"
}
],
"category": "methods"
}
}

View file

@ -1,8 +1,8 @@
{ {
"meta": {}, "meta": {},
"group": { "group": {
"title": "Stickers", "title": "Updating messages",
"anchor": "stickers" "anchor": "updating-messages"
}, },
"object": { "object": {
"anchor": "removechatverification", "anchor": "removechatverification",

View file

@ -1,8 +1,8 @@
{ {
"meta": {}, "meta": {},
"group": { "group": {
"title": "Stickers", "title": "Updating messages",
"anchor": "stickers" "anchor": "updating-messages"
}, },
"object": { "object": {
"anchor": "removeuserverification", "anchor": "removeuserverification",

View file

@ -1,8 +1,8 @@
{ {
"meta": {}, "meta": {},
"group": { "group": {
"title": "Stickers", "title": "Updating messages",
"anchor": "stickers" "anchor": "updating-messages"
}, },
"object": { "object": {
"anchor": "sendgift", "anchor": "sendgift",
@ -46,9 +46,9 @@
{ {
"type": "String", "type": "String",
"required": false, "required": false,
"description": "Text that will be shown along with the gift; 0-255 characters", "description": "Text that will be shown along with the gift; 0-128 characters",
"html_description": "<td>Text that will be shown along with the gift; 0-255 characters</td>", "html_description": "<td>Text that will be shown along with the gift; 0-128 characters</td>",
"rst_description": "Text that will be shown along with the gift; 0-255 characters\n", "rst_description": "Text that will be shown along with the gift; 0-128 characters\n",
"name": "text" "name": "text"
}, },
{ {

View file

@ -30,9 +30,9 @@
{ {
"type": "Integer", "type": "Integer",
"required": true, "required": true,
"description": "The number of Telegram Stars that must be paid to buy access to the media; 1-2500", "description": "The number of Telegram Stars that must be paid to buy access to the media; 1-10000",
"html_description": "<td>The number of Telegram Stars that must be paid to buy access to the media; 1-2500</td>", "html_description": "<td>The number of Telegram Stars that must be paid to buy access to the media; 1-10000</td>",
"rst_description": "The number of Telegram Stars that must be paid to buy access to the media; 1-2500\n", "rst_description": "The number of Telegram Stars that must be paid to buy access to the media; 1-10000\n",
"name": "star_count" "name": "star_count"
}, },
{ {

View file

@ -0,0 +1,33 @@
{
"meta": {},
"group": {
"title": "Updating messages",
"anchor": "updating-messages"
},
"object": {
"anchor": "setbusinessaccountbio",
"name": "setBusinessAccountBio",
"description": "Changes the bio of a managed business account. Requires the can_change_bio business bot right. Returns True on success.",
"html_description": "<p>Changes the bio of a managed business account. Requires the <em>can_change_bio</em> business bot right. Returns <em>True</em> on success.</p>",
"rst_description": "Changes the bio of a managed business account. Requires the *can_change_bio* business bot right. Returns :code:`True` on success.",
"annotations": [
{
"type": "String",
"required": true,
"description": "Unique identifier of the business connection",
"html_description": "<td>Unique identifier of the business connection</td>",
"rst_description": "Unique identifier of the business connection\n",
"name": "business_connection_id"
},
{
"type": "String",
"required": false,
"description": "The new value of the bio for the business account; 0-140 characters",
"html_description": "<td>The new value of the bio for the business account; 0-140 characters</td>",
"rst_description": "The new value of the bio for the business account; 0-140 characters\n",
"name": "bio"
}
],
"category": "methods"
}
}

View file

@ -0,0 +1,41 @@
{
"meta": {},
"group": {
"title": "Updating messages",
"anchor": "updating-messages"
},
"object": {
"anchor": "setbusinessaccountgiftsettings",
"name": "setBusinessAccountGiftSettings",
"description": "Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the can_change_gift_settings business bot right. Returns True on success.",
"html_description": "<p>Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the <em>can_change_gift_settings</em> business bot right. Returns <em>True</em> on success.</p>",
"rst_description": "Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the *can_change_gift_settings* business bot right. Returns :code:`True` on success.",
"annotations": [
{
"type": "String",
"required": true,
"description": "Unique identifier of the business connection",
"html_description": "<td>Unique identifier of the business connection</td>",
"rst_description": "Unique identifier of the business connection\n",
"name": "business_connection_id"
},
{
"type": "Boolean",
"required": true,
"description": "Pass True, if a button for sending a gift to the user or by the business account must always be shown in the input field",
"html_description": "<td>Pass True, if a button for sending a gift to the user or by the business account must always be shown in the input field</td>",
"rst_description": "Pass True, if a button for sending a gift to the user or by the business account must always be shown in the input field\n",
"name": "show_gift_button"
},
{
"type": "AcceptedGiftTypes",
"required": true,
"description": "Types of gifts accepted by the business account",
"html_description": "<td>Types of gifts accepted by the business account</td>",
"rst_description": "Types of gifts accepted by the business account\n",
"name": "accepted_gift_types"
}
],
"category": "methods"
}
}

View file

@ -0,0 +1,41 @@
{
"meta": {},
"group": {
"title": "Updating messages",
"anchor": "updating-messages"
},
"object": {
"anchor": "setbusinessaccountname",
"name": "setBusinessAccountName",
"description": "Changes the first and last name of a managed business account. Requires the can_change_name business bot right. Returns True on success.",
"html_description": "<p>Changes the first and last name of a managed business account. Requires the <em>can_change_name</em> business bot right. Returns <em>True</em> on success.</p>",
"rst_description": "Changes the first and last name of a managed business account. Requires the *can_change_name* business bot right. Returns :code:`True` on success.",
"annotations": [
{
"type": "String",
"required": true,
"description": "Unique identifier of the business connection",
"html_description": "<td>Unique identifier of the business connection</td>",
"rst_description": "Unique identifier of the business connection\n",
"name": "business_connection_id"
},
{
"type": "String",
"required": true,
"description": "The new value of the first name for the business account; 1-64 characters",
"html_description": "<td>The new value of the first name for the business account; 1-64 characters</td>",
"rst_description": "The new value of the first name for the business account; 1-64 characters\n",
"name": "first_name"
},
{
"type": "String",
"required": false,
"description": "The new value of the last name for the business account; 0-64 characters",
"html_description": "<td>The new value of the last name for the business account; 0-64 characters</td>",
"rst_description": "The new value of the last name for the business account; 0-64 characters\n",
"name": "last_name"
}
],
"category": "methods"
}
}

View file

@ -0,0 +1,41 @@
{
"meta": {},
"group": {
"title": "Updating messages",
"anchor": "updating-messages"
},
"object": {
"anchor": "setbusinessaccountprofilephoto",
"name": "setBusinessAccountProfilePhoto",
"description": "Changes the profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success.",
"html_description": "<p>Changes the profile photo of a managed business account. Requires the <em>can_edit_profile_photo</em> business bot right. Returns <em>True</em> on success.</p>",
"rst_description": "Changes the profile photo of a managed business account. Requires the *can_edit_profile_photo* business bot right. Returns :code:`True` on success.",
"annotations": [
{
"type": "String",
"required": true,
"description": "Unique identifier of the business connection",
"html_description": "<td>Unique identifier of the business connection</td>",
"rst_description": "Unique identifier of the business connection\n",
"name": "business_connection_id"
},
{
"type": "InputProfilePhoto",
"required": true,
"description": "The new profile photo to set",
"html_description": "<td>The new profile photo to set</td>",
"rst_description": "The new profile photo to set\n",
"name": "photo"
},
{
"type": "Boolean",
"required": false,
"description": "Pass True to set the public photo, which will be visible even if the main photo is hidden by the business account's privacy settings. An account can have only one public photo.",
"html_description": "<td>Pass True to set the public photo, which will be visible even if the main photo is hidden by the business account's privacy settings. An account can have only one public photo.</td>",
"rst_description": "Pass True to set the public photo, which will be visible even if the main photo is hidden by the business account's privacy settings. An account can have only one public photo.\n",
"name": "is_public"
}
],
"category": "methods"
}
}

View file

@ -0,0 +1,33 @@
{
"meta": {},
"group": {
"title": "Updating messages",
"anchor": "updating-messages"
},
"object": {
"anchor": "setbusinessaccountusername",
"name": "setBusinessAccountUsername",
"description": "Changes the username of a managed business account. Requires the can_change_username business bot right. Returns True on success.",
"html_description": "<p>Changes the username of a managed business account. Requires the <em>can_change_username</em> business bot right. Returns <em>True</em> on success.</p>",
"rst_description": "Changes the username of a managed business account. Requires the *can_change_username* business bot right. Returns :code:`True` on success.",
"annotations": [
{
"type": "String",
"required": true,
"description": "Unique identifier of the business connection",
"html_description": "<td>Unique identifier of the business connection</td>",
"rst_description": "Unique identifier of the business connection\n",
"name": "business_connection_id"
},
{
"type": "String",
"required": false,
"description": "The new value of the username for the business account; 0-32 characters",
"html_description": "<td>The new value of the username for the business account; 0-32 characters</td>",
"rst_description": "The new value of the username for the business account; 0-32 characters\n",
"name": "username"
}
],
"category": "methods"
}
}

View file

@ -0,0 +1,33 @@
{
"meta": {},
"group": {
"title": "Updating messages",
"anchor": "updating-messages"
},
"object": {
"anchor": "transferbusinessaccountstars",
"name": "transferBusinessAccountStars",
"description": "Transfers Telegram Stars from the business account balance to the bot's balance. Requires the can_transfer_stars business bot right. Returns True on success.",
"html_description": "<p>Transfers Telegram Stars from the business account balance to the bot's balance. Requires the <em>can_transfer_stars</em> business bot right. Returns <em>True</em> on success.</p>",
"rst_description": "Transfers Telegram Stars from the business account balance to the bot's balance. Requires the *can_transfer_stars* business bot right. Returns :code:`True` on success.",
"annotations": [
{
"type": "String",
"required": true,
"description": "Unique identifier of the business connection",
"html_description": "<td>Unique identifier of the business connection</td>",
"rst_description": "Unique identifier of the business connection\n",
"name": "business_connection_id"
},
{
"type": "Integer",
"required": true,
"description": "Number of Telegram Stars to transfer; 1-10000",
"html_description": "<td>Number of Telegram Stars to transfer; 1-10000</td>",
"rst_description": "Number of Telegram Stars to transfer; 1-10000\n",
"name": "star_count"
}
],
"category": "methods"
}
}

View file

@ -0,0 +1,49 @@
{
"meta": {},
"group": {
"title": "Updating messages",
"anchor": "updating-messages"
},
"object": {
"anchor": "transfergift",
"name": "transferGift",
"description": "Transfers an owned unique gift to another user. Requires the can_transfer_and_upgrade_gifts business bot right. Requires can_transfer_stars business bot right if the transfer is paid. Returns True on success.",
"html_description": "<p>Transfers an owned unique gift to another user. Requires the <em>can_transfer_and_upgrade_gifts</em> business bot right. Requires <em>can_transfer_stars</em> business bot right if the transfer is paid. Returns <em>True</em> on success.</p>",
"rst_description": "Transfers an owned unique gift to another user. Requires the *can_transfer_and_upgrade_gifts* business bot right. Requires *can_transfer_stars* business bot right if the transfer is paid. Returns :code:`True` on success.",
"annotations": [
{
"type": "String",
"required": true,
"description": "Unique identifier of the business connection",
"html_description": "<td>Unique identifier of the business connection</td>",
"rst_description": "Unique identifier of the business connection\n",
"name": "business_connection_id"
},
{
"type": "String",
"required": true,
"description": "Unique identifier of the regular gift that should be transferred",
"html_description": "<td>Unique identifier of the regular gift that should be transferred</td>",
"rst_description": "Unique identifier of the regular gift that should be transferred\n",
"name": "owned_gift_id"
},
{
"type": "Integer",
"required": true,
"description": "Unique identifier of the chat which will own the gift. The chat must be active in the last 24 hours.",
"html_description": "<td>Unique identifier of the chat which will own the gift. The chat must be active in the last 24 hours.</td>",
"rst_description": "Unique identifier of the chat which will own the gift. The chat must be active in the last 24 hours.\n",
"name": "new_owner_chat_id"
},
{
"type": "Integer",
"required": false,
"description": "The amount of Telegram Stars that will be paid for the transfer from the business account balance. If positive, then the can_transfer_stars business bot right is required.",
"html_description": "<td>The amount of Telegram Stars that will be paid for the transfer from the business account balance. If positive, then the <em>can_transfer_stars</em> business bot right is required.</td>",
"rst_description": "The amount of Telegram Stars that will be paid for the transfer from the business account balance. If positive, then the *can_transfer_stars* business bot right is required.\n",
"name": "star_count"
}
],
"category": "methods"
}
}

View file

@ -0,0 +1,49 @@
{
"meta": {},
"group": {
"title": "Updating messages",
"anchor": "updating-messages"
},
"object": {
"anchor": "upgradegift",
"name": "upgradeGift",
"description": "Upgrades a given regular gift to a unique gift. Requires the can_transfer_and_upgrade_gifts business bot right. Additionally requires the can_transfer_stars business bot right if the upgrade is paid. Returns True on success.",
"html_description": "<p>Upgrades a given regular gift to a unique gift. Requires the <em>can_transfer_and_upgrade_gifts</em> business bot right. Additionally requires the <em>can_transfer_stars</em> business bot right if the upgrade is paid. Returns <em>True</em> on success.</p>",
"rst_description": "Upgrades a given regular gift to a unique gift. Requires the *can_transfer_and_upgrade_gifts* business bot right. Additionally requires the *can_transfer_stars* business bot right if the upgrade is paid. Returns :code:`True` on success.",
"annotations": [
{
"type": "String",
"required": true,
"description": "Unique identifier of the business connection",
"html_description": "<td>Unique identifier of the business connection</td>",
"rst_description": "Unique identifier of the business connection\n",
"name": "business_connection_id"
},
{
"type": "String",
"required": true,
"description": "Unique identifier of the regular gift that should be upgraded to a unique one",
"html_description": "<td>Unique identifier of the regular gift that should be upgraded to a unique one</td>",
"rst_description": "Unique identifier of the regular gift that should be upgraded to a unique one\n",
"name": "owned_gift_id"
},
{
"type": "Boolean",
"required": false,
"description": "Pass True to keep the original gift text, sender and receiver in the upgraded gift",
"html_description": "<td>Pass True to keep the original gift text, sender and receiver in the upgraded gift</td>",
"rst_description": "Pass True to keep the original gift text, sender and receiver in the upgraded gift\n",
"name": "keep_original_details"
},
{
"type": "Integer",
"required": false,
"description": "The amount of Telegram Stars that will be paid for the upgrade from the business account balance. If gift.prepaid_upgrade_star_count > 0, then pass 0, otherwise, the can_transfer_stars business bot right is required and gift.upgrade_star_count must be passed.",
"html_description": "<td>The amount of Telegram Stars that will be paid for the upgrade from the business account balance. If <code>gift.prepaid_upgrade_star_count &gt; 0</code>, then pass 0, otherwise, the <em>can_transfer_stars</em> business bot right is required and <code>gift.upgrade_star_count</code> must be passed.</td>",
"rst_description": "The amount of Telegram Stars that will be paid for the upgrade from the business account balance. If :code:`gift.prepaid_upgrade_star_count > 0`, then pass 0, otherwise, the *can_transfer_stars* business bot right is required and :code:`gift.upgrade_star_count` must be passed.\n",
"name": "star_count"
}
],
"category": "methods"
}
}

View file

@ -1,8 +1,8 @@
{ {
"meta": {}, "meta": {},
"group": { "group": {
"title": "Stickers", "title": "Updating messages",
"anchor": "stickers" "anchor": "updating-messages"
}, },
"object": { "object": {
"anchor": "verifychat", "anchor": "verifychat",

View file

@ -1,8 +1,8 @@
{ {
"meta": {}, "meta": {},
"group": { "group": {
"title": "Stickers", "title": "Updating messages",
"anchor": "stickers" "anchor": "updating-messages"
}, },
"object": { "object": {
"anchor": "verifyuser", "anchor": "verifyuser",

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,49 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "acceptedgifttypes",
"name": "AcceptedGiftTypes",
"description": "This object describes the types of gifts that can be gifted to a user or a chat.",
"html_description": "<p>This object describes the types of gifts that can be gifted to a user or a chat.</p>",
"rst_description": "This object describes the types of gifts that can be gifted to a user or a chat.",
"annotations": [
{
"type": "Boolean",
"description": "True, if unlimited regular gifts are accepted",
"html_description": "<td>True, if unlimited regular gifts are accepted</td>",
"rst_description": "True, if unlimited regular gifts are accepted\n",
"name": "unlimited_gifts",
"required": true
},
{
"type": "Boolean",
"description": "True, if limited regular gifts are accepted",
"html_description": "<td>True, if limited regular gifts are accepted</td>",
"rst_description": "True, if limited regular gifts are accepted\n",
"name": "limited_gifts",
"required": true
},
{
"type": "Boolean",
"description": "True, if unique gifts or gifts that can be upgraded to unique for free are accepted",
"html_description": "<td>True, if unique gifts or gifts that can be upgraded to unique for free are accepted</td>",
"rst_description": "True, if unique gifts or gifts that can be upgraded to unique for free are accepted\n",
"name": "unique_gifts",
"required": true
},
{
"type": "Boolean",
"description": "True, if a Telegram Premium subscription is accepted",
"html_description": "<td>True, if a Telegram Premium subscription is accepted</td>",
"rst_description": "True, if a Telegram Premium subscription is accepted\n",
"name": "premium_subscription",
"required": true
}
],
"category": "types"
}
}

View file

@ -0,0 +1,129 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "businessbotrights",
"name": "BusinessBotRights",
"description": "Represents the rights of a business bot.",
"html_description": "<p>Represents the rights of a business bot.</p>",
"rst_description": "Represents the rights of a business bot.",
"annotations": [
{
"type": "True",
"description": "True, if the bot can send and edit messages in the private chats that had incoming messages in the last 24 hours",
"html_description": "<td><em>Optional</em>. True, if the bot can send and edit messages in the private chats that had incoming messages in the last 24 hours</td>",
"rst_description": "*Optional*. True, if the bot can send and edit messages in the private chats that had incoming messages in the last 24 hours\n",
"name": "can_reply",
"required": false
},
{
"type": "True",
"description": "True, if the bot can mark incoming private messages as read",
"html_description": "<td><em>Optional</em>. True, if the bot can mark incoming private messages as read</td>",
"rst_description": "*Optional*. True, if the bot can mark incoming private messages as read\n",
"name": "can_read_messages",
"required": false
},
{
"type": "True",
"description": "True, if the bot can delete messages sent by the bot",
"html_description": "<td><em>Optional</em>. True, if the bot can delete messages sent by the bot</td>",
"rst_description": "*Optional*. True, if the bot can delete messages sent by the bot\n",
"name": "can_delete_outgoing_messages",
"required": false
},
{
"type": "True",
"description": "True, if the bot can delete all private messages in managed chats",
"html_description": "<td><em>Optional</em>. True, if the bot can delete all private messages in managed chats</td>",
"rst_description": "*Optional*. True, if the bot can delete all private messages in managed chats\n",
"name": "can_delete_all_messages",
"required": false
},
{
"type": "True",
"description": "True, if the bot can edit the first and last name of the business account",
"html_description": "<td><em>Optional</em>. True, if the bot can edit the first and last name of the business account</td>",
"rst_description": "*Optional*. True, if the bot can edit the first and last name of the business account\n",
"name": "can_edit_name",
"required": false
},
{
"type": "True",
"description": "True, if the bot can edit the bio of the business account",
"html_description": "<td><em>Optional</em>. True, if the bot can edit the bio of the business account</td>",
"rst_description": "*Optional*. True, if the bot can edit the bio of the business account\n",
"name": "can_edit_bio",
"required": false
},
{
"type": "True",
"description": "True, if the bot can edit the profile photo of the business account",
"html_description": "<td><em>Optional</em>. True, if the bot can edit the profile photo of the business account</td>",
"rst_description": "*Optional*. True, if the bot can edit the profile photo of the business account\n",
"name": "can_edit_profile_photo",
"required": false
},
{
"type": "True",
"description": "True, if the bot can edit the username of the business account",
"html_description": "<td><em>Optional</em>. True, if the bot can edit the username of the business account</td>",
"rst_description": "*Optional*. True, if the bot can edit the username of the business account\n",
"name": "can_edit_username",
"required": false
},
{
"type": "True",
"description": "True, if the bot can change the privacy settings pertaining to gifts for the business account",
"html_description": "<td><em>Optional</em>. True, if the bot can change the privacy settings pertaining to gifts for the business account</td>",
"rst_description": "*Optional*. True, if the bot can change the privacy settings pertaining to gifts for the business account\n",
"name": "can_change_gift_settings",
"required": false
},
{
"type": "True",
"description": "True, if the bot can view gifts and the amount of Telegram Stars owned by the business account",
"html_description": "<td><em>Optional</em>. True, if the bot can view gifts and the amount of Telegram Stars owned by the business account</td>",
"rst_description": "*Optional*. True, if the bot can view gifts and the amount of Telegram Stars owned by the business account\n",
"name": "can_view_gifts_and_stars",
"required": false
},
{
"type": "True",
"description": "True, if the bot can convert regular gifts owned by the business account to Telegram Stars",
"html_description": "<td><em>Optional</em>. True, if the bot can convert regular gifts owned by the business account to Telegram Stars</td>",
"rst_description": "*Optional*. True, if the bot can convert regular gifts owned by the business account to Telegram Stars\n",
"name": "can_convert_gifts_to_stars",
"required": false
},
{
"type": "True",
"description": "True, if the bot can transfer and upgrade gifts owned by the business account",
"html_description": "<td><em>Optional</em>. True, if the bot can transfer and upgrade gifts owned by the business account</td>",
"rst_description": "*Optional*. True, if the bot can transfer and upgrade gifts owned by the business account\n",
"name": "can_transfer_and_upgrade_gifts",
"required": false
},
{
"type": "True",
"description": "True, if the bot can transfer Telegram Stars received by the business account to its own account, or use them to upgrade and transfer gifts",
"html_description": "<td><em>Optional</em>. True, if the bot can transfer Telegram Stars received by the business account to its own account, or use them to upgrade and transfer gifts</td>",
"rst_description": "*Optional*. True, if the bot can transfer Telegram Stars received by the business account to its own account, or use them to upgrade and transfer gifts\n",
"name": "can_transfer_stars",
"required": false
},
{
"type": "True",
"description": "True, if the bot can post, edit and delete stories on behalf of the business account",
"html_description": "<td><em>Optional</em>. True, if the bot can post, edit and delete stories on behalf of the business account</td>",
"rst_description": "*Optional*. True, if the bot can post, edit and delete stories on behalf of the business account\n",
"name": "can_manage_stories",
"required": false
}
],
"category": "types"
}
}

View file

@ -44,12 +44,12 @@
"required": true "required": true
}, },
{ {
"type": "Boolean", "type": "BusinessBotRights",
"description": "True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours", "description": "Rights of the business bot",
"html_description": "<td>True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours</td>", "html_description": "<td><em>Optional</em>. Rights of the business bot</td>",
"rst_description": "True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours\n", "rst_description": "*Optional*. Rights of the business bot\n",
"name": "can_reply", "name": "rights",
"required": true "required": false
}, },
{ {
"type": "Boolean", "type": "Boolean",
@ -58,6 +58,18 @@
"rst_description": "True, if the connection is active\n", "rst_description": "True, if the connection is active\n",
"name": "is_enabled", "name": "is_enabled",
"required": true "required": true
},
{
"type": "Boolean",
"description": "True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours",
"html_description": "<td>True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours</td>",
"rst_description": "True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours\n",
"name": "can_reply",
"required": false,
"deprecated": {
"version": "9.0",
"release_date": "2025-04-11"
}
} }
], ],
"category": "types" "category": "types"

View file

@ -260,12 +260,12 @@
"required": false "required": false
}, },
{ {
"type": "True", "type": "AcceptedGiftTypes",
"description": "True, if gifts can be sent to the chat", "description": "Information about types of gifts that are accepted by the chat or by the corresponding user for private chats",
"html_description": "<td><em>Optional</em>. <em>True</em>, if gifts can be sent to the chat</td>", "html_description": "<td>Information about types of gifts that are accepted by the chat or by the corresponding user for private chats</td>",
"rst_description": "*Optional*. :code:`True`, if gifts can be sent to the chat\n", "rst_description": "Information about types of gifts that are accepted by the chat or by the corresponding user for private chats\n",
"name": "can_send_gift", "name": "accepted_gift_types",
"required": false "required": true
}, },
{ {
"type": "True", "type": "True",
@ -370,6 +370,18 @@
"rst_description": "*Optional*. For supergroups, the location to which the supergroup is connected\n", "rst_description": "*Optional*. For supergroups, the location to which the supergroup is connected\n",
"name": "location", "name": "location",
"required": false "required": false
},
{
"type": "True",
"description": "True, if gifts can be sent to the chat",
"html_description": "<td><em>Optional</em>. <em>True</em>, if gifts can be sent to the chat</td>",
"rst_description": "*Optional*. :code:`True`, if gifts can be sent to the chat\n",
"name": "can_send_gift",
"required": false,
"deprecated": {
"version": "9.0",
"release_date": "2025-04-11"
}
} }
], ],
"category": "types" "category": "types"

View file

@ -1,8 +1,8 @@
{ {
"meta": {}, "meta": {},
"group": { "group": {
"title": "Stickers", "title": "Available types",
"anchor": "stickers" "anchor": "available-types"
}, },
"object": { "object": {
"anchor": "gift", "anchor": "gift",

View file

@ -0,0 +1,81 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "giftinfo",
"name": "GiftInfo",
"description": "Describes a service message about a regular gift that was sent or received.",
"html_description": "<p>Describes a service message about a regular gift that was sent or received.</p>",
"rst_description": "Describes a service message about a regular gift that was sent or received.",
"annotations": [
{
"type": "Gift",
"description": "Information about the gift",
"html_description": "<td>Information about the gift</td>",
"rst_description": "Information about the gift\n",
"name": "gift",
"required": true
},
{
"type": "String",
"description": "Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts",
"html_description": "<td><em>Optional</em>. Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts</td>",
"rst_description": "*Optional*. Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts\n",
"name": "owned_gift_id",
"required": false
},
{
"type": "Integer",
"description": "Number of Telegram Stars that can be claimed by the receiver by converting the gift; omitted if conversion to Telegram Stars is impossible",
"html_description": "<td><em>Optional</em>. Number of Telegram Stars that can be claimed by the receiver by converting the gift; omitted if conversion to Telegram Stars is impossible</td>",
"rst_description": "*Optional*. Number of Telegram Stars that can be claimed by the receiver by converting the gift; omitted if conversion to Telegram Stars is impossible\n",
"name": "convert_star_count",
"required": false
},
{
"type": "Integer",
"description": "Number of Telegram Stars that were prepaid by the sender for the ability to upgrade the gift",
"html_description": "<td><em>Optional</em>. Number of Telegram Stars that were prepaid by the sender for the ability to upgrade the gift</td>",
"rst_description": "*Optional*. Number of Telegram Stars that were prepaid by the sender for the ability to upgrade the gift\n",
"name": "prepaid_upgrade_star_count",
"required": false
},
{
"type": "True",
"description": "True, if the gift can be upgraded to a unique gift",
"html_description": "<td><em>Optional</em>. True, if the gift can be upgraded to a unique gift</td>",
"rst_description": "*Optional*. True, if the gift can be upgraded to a unique gift\n",
"name": "can_be_upgraded",
"required": false
},
{
"type": "String",
"description": "Text of the message that was added to the gift",
"html_description": "<td><em>Optional</em>. Text of the message that was added to the gift</td>",
"rst_description": "*Optional*. Text of the message that was added to the gift\n",
"name": "text",
"required": false
},
{
"type": "Array of MessageEntity",
"description": "Special entities that appear in the text",
"html_description": "<td><em>Optional</em>. Special entities that appear in the text</td>",
"rst_description": "*Optional*. Special entities that appear in the text\n",
"name": "entities",
"required": false
},
{
"type": "True",
"description": "True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them",
"html_description": "<td><em>Optional</em>. True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them</td>",
"rst_description": "*Optional*. True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them\n",
"name": "is_private",
"required": false
}
],
"category": "types"
}
}

View file

@ -1,8 +1,8 @@
{ {
"meta": {}, "meta": {},
"group": { "group": {
"title": "Stickers", "title": "Available types",
"anchor": "stickers" "anchor": "available-types"
}, },
"object": { "object": {
"anchor": "gifts", "anchor": "gifts",

View file

@ -0,0 +1,16 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "inputprofilephoto",
"name": "InputProfilePhoto",
"description": "This object describes a profile photo to set. Currently, it can be one of\n - InputProfilePhotoStatic\n - InputProfilePhotoAnimated",
"html_description": "<p>This object describes a profile photo to set. Currently, it can be one of</p><ul>\n<li><a href=\"#inputprofilephotostatic\">InputProfilePhotoStatic</a></li>\n<li><a href=\"#inputprofilephotoanimated\">InputProfilePhotoAnimated</a></li>\n</ul>",
"rst_description": "This object describes a profile photo to set. Currently, it can be one of\n\n - :class:`aiogram.types.input_profile_photo_static.InputProfilePhotoStatic`\n - :class:`aiogram.types.input_profile_photo_animated.InputProfilePhotoAnimated`",
"annotations": [],
"category": "types"
}
}

View file

@ -0,0 +1 @@
discriminator: "type"

View file

@ -0,0 +1,41 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "inputprofilephotoanimated",
"name": "InputProfilePhotoAnimated",
"description": "An animated profile photo in the MPEG4 format.",
"html_description": "<p>An animated profile photo in the MPEG4 format.</p>",
"rst_description": "An animated profile photo in the MPEG4 format.",
"annotations": [
{
"type": "String",
"description": "Type of the profile photo, must be 'animated'",
"html_description": "<td>Type of the profile photo, must be &#8220;animated&#8221;</td>",
"rst_description": "Type of the profile photo, must be 'animated'\n",
"name": "type",
"required": true
},
{
"type": "String",
"description": "The animated profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the photo was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files",
"html_description": "<td>The animated profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass &#8220;attach://&lt;file_attach_name&gt;&#8221; if the photo was uploaded using multipart/form-data under &lt;file_attach_name&gt;. <a href=\"#sending-files\">More information on Sending Files &#187;</a></td>",
"rst_description": "The animated profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the photo was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`\n",
"name": "animation",
"required": true
},
{
"type": "Float",
"description": "Timestamp in seconds of the frame that will be used as the static profile photo. Defaults to 0.0.",
"html_description": "<td><em>Optional</em>. Timestamp in seconds of the frame that will be used as the static profile photo. Defaults to 0.0.</td>",
"rst_description": "*Optional*. Timestamp in seconds of the frame that will be used as the static profile photo. Defaults to 0.0.\n",
"name": "main_frame_timestamp",
"required": false
}
],
"category": "types"
}
}

View file

@ -0,0 +1,11 @@
annotations:
animation:
parsed_type:
type: union
items:
- type: std
name: str
- type: entity
references:
category: types
name: InputFile

View file

@ -0,0 +1,33 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "inputprofilephotostatic",
"name": "InputProfilePhotoStatic",
"description": "A static profile photo in the .JPG format.",
"html_description": "<p>A static profile photo in the .JPG format.</p>",
"rst_description": "A static profile photo in the .JPG format.",
"annotations": [
{
"type": "String",
"description": "Type of the profile photo, must be 'static'",
"html_description": "<td>Type of the profile photo, must be &#8220;static&#8221;</td>",
"rst_description": "Type of the profile photo, must be 'static'\n",
"name": "type",
"required": true
},
{
"type": "String",
"description": "The static profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the photo was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files",
"html_description": "<td>The static profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass &#8220;attach://&lt;file_attach_name&gt;&#8221; if the photo was uploaded using multipart/form-data under &lt;file_attach_name&gt;. <a href=\"#sending-files\">More information on Sending Files &#187;</a></td>",
"rst_description": "The static profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the photo was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`\n",
"name": "photo",
"required": true
}
],
"category": "types"
}
}

View file

@ -0,0 +1,11 @@
annotations:
photo:
parsed_type:
type: union
items:
- type: std
name: str
- type: entity
references:
category: types
name: InputFile

View file

@ -12,10 +12,10 @@
"rst_description": "This object describes a sticker to be added to a sticker set.", "rst_description": "This object describes a sticker to be added to a sticker set.",
"annotations": [ "annotations": [
{ {
"type": "InputFile or String", "type": "String",
"description": "The added sticker. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, upload a new one using multipart/form-data, or pass 'attach://<file_attach_name>' to upload a new one using multipart/form-data under <file_attach_name> name. Animated and video stickers can't be uploaded via HTTP URL. More information on Sending Files", "description": "The added sticker. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or pass 'attach://<file_attach_name>' to upload a new file using multipart/form-data under <file_attach_name> name. Animated and video stickers can't be uploaded via HTTP URL. More information on Sending Files",
"html_description": "<td>The added sticker. Pass a <em>file_id</em> as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, upload a new one using multipart/form-data, or pass &#8220;attach://&lt;file_attach_name&gt;&#8221; to upload a new one using multipart/form-data under &lt;file_attach_name&gt; name. Animated and video stickers can't be uploaded via HTTP URL. <a href=\"#sending-files\">More information on Sending Files &#187;</a></td>", "html_description": "<td>The added sticker. Pass a <em>file_id</em> as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or pass &#8220;attach://&lt;file_attach_name&gt;&#8221; to upload a new file using multipart/form-data under &lt;file_attach_name&gt; name. Animated and video stickers can't be uploaded via HTTP URL. <a href=\"#sending-files\">More information on Sending Files &#187;</a></td>",
"rst_description": "The added sticker. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, upload a new one using multipart/form-data, or pass 'attach://<file_attach_name>' to upload a new one using multipart/form-data under <file_attach_name> name. Animated and video stickers can't be uploaded via HTTP URL. :ref:`More information on Sending Files » <sending-files>`\n", "rst_description": "The added sticker. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or pass 'attach://<file_attach_name>' to upload a new file using multipart/form-data under <file_attach_name> name. Animated and video stickers can't be uploaded via HTTP URL. :ref:`More information on Sending Files » <sending-files>`\n",
"name": "sticker", "name": "sticker",
"required": true "required": true
}, },

View file

@ -0,0 +1,11 @@
annotations:
sticker:
parsed_type:
type: union
items:
- type: std
name: str
- type: entity
references:
category: types
name: InputFile

View file

@ -0,0 +1,16 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "inputstorycontent",
"name": "InputStoryContent",
"description": "This object describes the content of a story to post. Currently, it can be one of\n - InputStoryContentPhoto\n - InputStoryContentVideo",
"html_description": "<p>This object describes the content of a story to post. Currently, it can be one of</p><ul>\n<li><a href=\"#inputstorycontentphoto\">InputStoryContentPhoto</a></li>\n<li><a href=\"#inputstorycontentvideo\">InputStoryContentVideo</a></li>\n</ul>",
"rst_description": "This object describes the content of a story to post. Currently, it can be one of\n\n - :class:`aiogram.types.input_story_content_photo.InputStoryContentPhoto`\n - :class:`aiogram.types.input_story_content_video.InputStoryContentVideo`",
"annotations": [],
"category": "types"
}
}

View file

@ -0,0 +1 @@
discriminator: "type"

View file

@ -0,0 +1,33 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "inputstorycontentphoto",
"name": "InputStoryContentPhoto",
"description": "Describes a photo to post as a story.",
"html_description": "<p>Describes a photo to post as a story.</p>",
"rst_description": "Describes a photo to post as a story.",
"annotations": [
{
"type": "String",
"description": "Type of the content, must be 'photo'",
"html_description": "<td>Type of the content, must be &#8220;photo&#8221;</td>",
"rst_description": "Type of the content, must be 'photo'\n",
"name": "type",
"required": true
},
{
"type": "String",
"description": "The photo to post as a story. The photo must be of the size 1080x1920 and must not exceed 10 MB. The photo can't be reused and can only be uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the photo was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files",
"html_description": "<td>The photo to post as a story. The photo must be of the size 1080x1920 and must not exceed 10 MB. The photo can't be reused and can only be uploaded as a new file, so you can pass &#8220;attach://&lt;file_attach_name&gt;&#8221; if the photo was uploaded using multipart/form-data under &lt;file_attach_name&gt;. <a href=\"#sending-files\">More information on Sending Files &#187;</a></td>",
"rst_description": "The photo to post as a story. The photo must be of the size 1080x1920 and must not exceed 10 MB. The photo can't be reused and can only be uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the photo was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`\n",
"name": "photo",
"required": true
}
],
"category": "types"
}
}

View file

@ -0,0 +1,57 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "inputstorycontentvideo",
"name": "InputStoryContentVideo",
"description": "Describes a video to post as a story.",
"html_description": "<p>Describes a video to post as a story.</p>",
"rst_description": "Describes a video to post as a story.",
"annotations": [
{
"type": "String",
"description": "Type of the content, must be 'video'",
"html_description": "<td>Type of the content, must be &#8220;video&#8221;</td>",
"rst_description": "Type of the content, must be 'video'\n",
"name": "type",
"required": true
},
{
"type": "String",
"description": "The video to post as a story. The video must be of the size 720x1280, streamable, encoded with H.265 codec, with key frames added each second in the MPEG4 format, and must not exceed 30 MB. The video can't be reused and can only be uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the video was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files",
"html_description": "<td>The video to post as a story. The video must be of the size 720x1280, streamable, encoded with H.265 codec, with key frames added each second in the MPEG4 format, and must not exceed 30 MB. The video can't be reused and can only be uploaded as a new file, so you can pass &#8220;attach://&lt;file_attach_name&gt;&#8221; if the video was uploaded using multipart/form-data under &lt;file_attach_name&gt;. <a href=\"#sending-files\">More information on Sending Files &#187;</a></td>",
"rst_description": "The video to post as a story. The video must be of the size 720x1280, streamable, encoded with H.265 codec, with key frames added each second in the MPEG4 format, and must not exceed 30 MB. The video can't be reused and can only be uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the video was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`\n",
"name": "video",
"required": true
},
{
"type": "Float",
"description": "Precise duration of the video in seconds; 0-60",
"html_description": "<td><em>Optional</em>. Precise duration of the video in seconds; 0-60</td>",
"rst_description": "*Optional*. Precise duration of the video in seconds; 0-60\n",
"name": "duration",
"required": false
},
{
"type": "Float",
"description": "Timestamp in seconds of the frame that will be used as the static cover for the story. Defaults to 0.0.",
"html_description": "<td><em>Optional</em>. Timestamp in seconds of the frame that will be used as the static cover for the story. Defaults to 0.0.</td>",
"rst_description": "*Optional*. Timestamp in seconds of the frame that will be used as the static cover for the story. Defaults to 0.0.\n",
"name": "cover_frame_timestamp",
"required": false
},
{
"type": "Boolean",
"description": "Pass True if the video has no sound",
"html_description": "<td><em>Optional</em>. Pass <em>True</em> if the video has no sound</td>",
"rst_description": "*Optional*. Pass :code:`True` if the video has no sound\n",
"name": "is_animation",
"required": false
}
],
"category": "types"
}
}

View file

@ -0,0 +1,49 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "locationaddress",
"name": "LocationAddress",
"description": "Describes the physical address of a location.",
"html_description": "<p>Describes the physical address of a location.</p>",
"rst_description": "Describes the physical address of a location.",
"annotations": [
{
"type": "String",
"description": "The two-letter ISO 3166-1 alpha-2 country code of the country where the location is located",
"html_description": "<td>The two-letter ISO 3166-1 alpha-2 country code of the country where the location is located</td>",
"rst_description": "The two-letter ISO 3166-1 alpha-2 country code of the country where the location is located\n",
"name": "country_code",
"required": true
},
{
"type": "String",
"description": "State of the location",
"html_description": "<td><em>Optional</em>. State of the location</td>",
"rst_description": "*Optional*. State of the location\n",
"name": "state",
"required": false
},
{
"type": "String",
"description": "City of the location",
"html_description": "<td><em>Optional</em>. City of the location</td>",
"rst_description": "*Optional*. City of the location\n",
"name": "city",
"required": false
},
{
"type": "String",
"description": "Street address of the location",
"html_description": "<td><em>Optional</em>. Street address of the location</td>",
"rst_description": "*Optional*. Street address of the location\n",
"name": "street",
"required": false
}
],
"category": "types"
}
}

View file

@ -187,6 +187,14 @@
"name": "author_signature", "name": "author_signature",
"required": false "required": false
}, },
{
"type": "Integer",
"description": "The number of Telegram Stars that were paid by the sender of the message to send it",
"html_description": "<td><em>Optional</em>. The number of Telegram Stars that were paid by the sender of the message to send it</td>",
"rst_description": "*Optional*. The number of Telegram Stars that were paid by the sender of the message to send it\n",
"name": "paid_star_count",
"required": false
},
{ {
"type": "String", "type": "String",
"description": "For text messages, the actual UTF-8 text of the message", "description": "For text messages, the actual UTF-8 text of the message",
@ -515,6 +523,22 @@
"name": "chat_shared", "name": "chat_shared",
"required": false "required": false
}, },
{
"type": "GiftInfo",
"description": "Service message: a regular gift was sent or received",
"html_description": "<td><em>Optional</em>. Service message: a regular gift was sent or received</td>",
"rst_description": "*Optional*. Service message: a regular gift was sent or received\n",
"name": "gift",
"required": false
},
{
"type": "UniqueGiftInfo",
"description": "Service message: a unique gift was sent or received",
"html_description": "<td><em>Optional</em>. Service message: a unique gift was sent or received</td>",
"rst_description": "*Optional*. Service message: a unique gift was sent or received\n",
"name": "unique_gift",
"required": false
},
{ {
"type": "String", "type": "String",
"description": "The domain name of the website on which the user has logged in.", "description": "The domain name of the website on which the user has logged in.",
@ -643,6 +667,14 @@
"name": "giveaway_completed", "name": "giveaway_completed",
"required": false "required": false
}, },
{
"type": "PaidMessagePriceChanged",
"description": "Service message: the price for paid messages has changed in the chat",
"html_description": "<td><em>Optional</em>. Service message: the price for paid messages has changed in the chat</td>",
"rst_description": "*Optional*. Service message: the price for paid messages has changed in the chat\n",
"name": "paid_message_price_changed",
"required": false
},
{ {
"type": "VideoChatScheduled", "type": "VideoChatScheduled",
"description": "Service message: video chat scheduled", "description": "Service message: video chat scheduled",

View file

@ -0,0 +1,16 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "ownedgift",
"name": "OwnedGift",
"description": "This object describes a gift received and owned by a user or a chat. Currently, it can be one of\n - OwnedGiftRegular\n - OwnedGiftUnique",
"html_description": "<p>This object describes a gift received and owned by a user or a chat. Currently, it can be one of</p><ul>\n<li><a href=\"#ownedgiftregular\">OwnedGiftRegular</a></li>\n<li><a href=\"#ownedgiftunique\">OwnedGiftUnique</a></li>\n</ul>",
"rst_description": "This object describes a gift received and owned by a user or a chat. Currently, it can be one of\n\n - :class:`aiogram.types.owned_gift_regular.OwnedGiftRegular`\n - :class:`aiogram.types.owned_gift_unique.OwnedGiftUnique`",
"annotations": [],
"category": "types"
}
}

View file

@ -0,0 +1 @@
discriminator: "type"

View file

@ -0,0 +1,121 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "ownedgiftregular",
"name": "OwnedGiftRegular",
"description": "Describes a regular gift owned by a user or a chat.",
"html_description": "<p>Describes a regular gift owned by a user or a chat.</p>",
"rst_description": "Describes a regular gift owned by a user or a chat.",
"annotations": [
{
"type": "String",
"description": "Type of the gift, always 'regular'",
"html_description": "<td>Type of the gift, always &#8220;regular&#8221;</td>",
"rst_description": "Type of the gift, always 'regular'\n",
"name": "type",
"required": true
},
{
"type": "Gift",
"description": "Information about the regular gift",
"html_description": "<td>Information about the regular gift</td>",
"rst_description": "Information about the regular gift\n",
"name": "gift",
"required": true
},
{
"type": "String",
"description": "Unique identifier of the gift for the bot; for gifts received on behalf of business accounts only",
"html_description": "<td><em>Optional</em>. Unique identifier of the gift for the bot; for gifts received on behalf of business accounts only</td>",
"rst_description": "*Optional*. Unique identifier of the gift for the bot; for gifts received on behalf of business accounts only\n",
"name": "owned_gift_id",
"required": false
},
{
"type": "User",
"description": "Sender of the gift if it is a known user",
"html_description": "<td><em>Optional</em>. Sender of the gift if it is a known user</td>",
"rst_description": "*Optional*. Sender of the gift if it is a known user\n",
"name": "sender_user",
"required": false
},
{
"type": "Integer",
"description": "Date the gift was sent in Unix time",
"html_description": "<td>Date the gift was sent in Unix time</td>",
"rst_description": "Date the gift was sent in Unix time\n",
"name": "send_date",
"required": true
},
{
"type": "String",
"description": "Text of the message that was added to the gift",
"html_description": "<td><em>Optional</em>. Text of the message that was added to the gift</td>",
"rst_description": "*Optional*. Text of the message that was added to the gift\n",
"name": "text",
"required": false
},
{
"type": "Array of MessageEntity",
"description": "Special entities that appear in the text",
"html_description": "<td><em>Optional</em>. Special entities that appear in the text</td>",
"rst_description": "*Optional*. Special entities that appear in the text\n",
"name": "entities",
"required": false
},
{
"type": "True",
"description": "True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them",
"html_description": "<td><em>Optional</em>. True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them</td>",
"rst_description": "*Optional*. True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them\n",
"name": "is_private",
"required": false
},
{
"type": "True",
"description": "True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only",
"html_description": "<td><em>Optional</em>. True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only</td>",
"rst_description": "*Optional*. True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only\n",
"name": "is_saved",
"required": false
},
{
"type": "True",
"description": "True, if the gift can be upgraded to a unique gift; for gifts received on behalf of business accounts only",
"html_description": "<td><em>Optional</em>. True, if the gift can be upgraded to a unique gift; for gifts received on behalf of business accounts only</td>",
"rst_description": "*Optional*. True, if the gift can be upgraded to a unique gift; for gifts received on behalf of business accounts only\n",
"name": "can_be_upgraded",
"required": false
},
{
"type": "True",
"description": "True, if the gift was refunded and isn't available anymore",
"html_description": "<td><em>Optional</em>. True, if the gift was refunded and isn't available anymore</td>",
"rst_description": "*Optional*. True, if the gift was refunded and isn't available anymore\n",
"name": "was_refunded",
"required": false
},
{
"type": "Integer",
"description": "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",
"html_description": "<td><em>Optional</em>. 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</td>",
"rst_description": "*Optional*. 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\n",
"name": "convert_star_count",
"required": false
},
{
"type": "Integer",
"description": "Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift",
"html_description": "<td><em>Optional</em>. Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift</td>",
"rst_description": "*Optional*. Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift\n",
"name": "prepaid_upgrade_star_count",
"required": false
}
],
"category": "types"
}
}

View file

@ -0,0 +1,81 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "ownedgiftunique",
"name": "OwnedGiftUnique",
"description": "Describes a unique gift received and owned by a user or a chat.",
"html_description": "<p>Describes a unique gift received and owned by a user or a chat.</p>",
"rst_description": "Describes a unique gift received and owned by a user or a chat.",
"annotations": [
{
"type": "String",
"description": "Type of the gift, always 'unique'",
"html_description": "<td>Type of the gift, always &#8220;unique&#8221;</td>",
"rst_description": "Type of the gift, always 'unique'\n",
"name": "type",
"required": true
},
{
"type": "UniqueGift",
"description": "Information about the unique gift",
"html_description": "<td>Information about the unique gift</td>",
"rst_description": "Information about the unique gift\n",
"name": "gift",
"required": true
},
{
"type": "String",
"description": "Unique identifier of the received gift for the bot; for gifts received on behalf of business accounts only",
"html_description": "<td><em>Optional</em>. Unique identifier of the received gift for the bot; for gifts received on behalf of business accounts only</td>",
"rst_description": "*Optional*. Unique identifier of the received gift for the bot; for gifts received on behalf of business accounts only\n",
"name": "owned_gift_id",
"required": false
},
{
"type": "User",
"description": "Sender of the gift if it is a known user",
"html_description": "<td><em>Optional</em>. Sender of the gift if it is a known user</td>",
"rst_description": "*Optional*. Sender of the gift if it is a known user\n",
"name": "sender_user",
"required": false
},
{
"type": "Integer",
"description": "Date the gift was sent in Unix time",
"html_description": "<td>Date the gift was sent in Unix time</td>",
"rst_description": "Date the gift was sent in Unix time\n",
"name": "send_date",
"required": true
},
{
"type": "True",
"description": "True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only",
"html_description": "<td><em>Optional</em>. True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only</td>",
"rst_description": "*Optional*. True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only\n",
"name": "is_saved",
"required": false
},
{
"type": "True",
"description": "True, if the gift can be transferred to another owner; for gifts received on behalf of business accounts only",
"html_description": "<td><em>Optional</em>. True, if the gift can be transferred to another owner; for gifts received on behalf of business accounts only</td>",
"rst_description": "*Optional*. True, if the gift can be transferred to another owner; for gifts received on behalf of business accounts only\n",
"name": "can_be_transferred",
"required": false
},
{
"type": "Integer",
"description": "Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift",
"html_description": "<td><em>Optional</em>. Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift</td>",
"rst_description": "*Optional*. Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift\n",
"name": "transfer_star_count",
"required": false
}
],
"category": "types"
}
}

View file

@ -0,0 +1,41 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "ownedgifts",
"name": "OwnedGifts",
"description": "Contains the list of gifts received and owned by a user or a chat.",
"html_description": "<p>Contains the list of gifts received and owned by a user or a chat.</p>",
"rst_description": "Contains the list of gifts received and owned by a user or a chat.",
"annotations": [
{
"type": "Integer",
"description": "The total number of gifts owned by the user or the chat",
"html_description": "<td>The total number of gifts owned by the user or the chat</td>",
"rst_description": "The total number of gifts owned by the user or the chat\n",
"name": "total_count",
"required": true
},
{
"type": "Array of OwnedGift",
"description": "The list of gifts",
"html_description": "<td>The list of gifts</td>",
"rst_description": "The list of gifts\n",
"name": "gifts",
"required": true
},
{
"type": "String",
"description": "Offset for the next request. If empty, then there are no more results",
"html_description": "<td><em>Optional</em>. Offset for the next request. If empty, then there are no more results</td>",
"rst_description": "*Optional*. Offset for the next request. If empty, then there are no more results\n",
"name": "next_offset",
"required": false
}
],
"category": "types"
}
}

View file

@ -0,0 +1,25 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "paidmessagepricechanged",
"name": "PaidMessagePriceChanged",
"description": "Describes a service message about a change in the price of paid messages within a chat.",
"html_description": "<p>Describes a service message about a change in the price of paid messages within a chat.</p>",
"rst_description": "Describes a service message about a change in the price of paid messages within a chat.",
"annotations": [
{
"type": "Integer",
"description": "The new number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message",
"html_description": "<td>The new number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message</td>",
"rst_description": "The new number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message\n",
"name": "paid_message_star_count",
"required": true
}
],
"category": "types"
}
}

View file

@ -0,0 +1,33 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "staramount",
"name": "StarAmount",
"description": "Describes an amount of Telegram Stars.",
"html_description": "<p>Describes an amount of Telegram Stars.</p>",
"rst_description": "Describes an amount of Telegram Stars.",
"annotations": [
{
"type": "Integer",
"description": "Integer amount of Telegram Stars, rounded to 0; can be negative",
"html_description": "<td>Integer amount of Telegram Stars, rounded to 0; can be negative</td>",
"rst_description": "Integer amount of Telegram Stars, rounded to 0; can be negative\n",
"name": "amount",
"required": true
},
{
"type": "Integer",
"description": "The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999; can be negative if and only if amount is non-positive",
"html_description": "<td><em>Optional</em>. The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999; can be negative if and only if <em>amount</em> is non-positive</td>",
"rst_description": "*Optional*. The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999; can be negative if and only if *amount* is non-positive\n",
"name": "nanostar_amount",
"required": false
}
],
"category": "types"
}
}

View file

@ -0,0 +1,33 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "storyarea",
"name": "StoryArea",
"description": "Describes a clickable area on a story media.",
"html_description": "<p>Describes a clickable area on a story media.</p>",
"rst_description": "Describes a clickable area on a story media.",
"annotations": [
{
"type": "StoryAreaPosition",
"description": "Position of the area",
"html_description": "<td>Position of the area</td>",
"rst_description": "Position of the area\n",
"name": "position",
"required": true
},
{
"type": "StoryAreaType",
"description": "Type of the area",
"html_description": "<td>Type of the area</td>",
"rst_description": "Type of the area\n",
"name": "type",
"required": true
}
],
"category": "types"
}
}

View file

@ -0,0 +1,65 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "storyareaposition",
"name": "StoryAreaPosition",
"description": "Describes the position of a clickable area within a story.",
"html_description": "<p>Describes the position of a clickable area within a story.</p>",
"rst_description": "Describes the position of a clickable area within a story.",
"annotations": [
{
"type": "Float",
"description": "The abscissa of the area's center, as a percentage of the media width",
"html_description": "<td>The abscissa of the area's center, as a percentage of the media width</td>",
"rst_description": "The abscissa of the area's center, as a percentage of the media width\n",
"name": "x_percentage",
"required": true
},
{
"type": "Float",
"description": "The ordinate of the area's center, as a percentage of the media height",
"html_description": "<td>The ordinate of the area's center, as a percentage of the media height</td>",
"rst_description": "The ordinate of the area's center, as a percentage of the media height\n",
"name": "y_percentage",
"required": true
},
{
"type": "Float",
"description": "The width of the area's rectangle, as a percentage of the media width",
"html_description": "<td>The width of the area's rectangle, as a percentage of the media width</td>",
"rst_description": "The width of the area's rectangle, as a percentage of the media width\n",
"name": "width_percentage",
"required": true
},
{
"type": "Float",
"description": "The height of the area's rectangle, as a percentage of the media height",
"html_description": "<td>The height of the area's rectangle, as a percentage of the media height</td>",
"rst_description": "The height of the area's rectangle, as a percentage of the media height\n",
"name": "height_percentage",
"required": true
},
{
"type": "Float",
"description": "The clockwise rotation angle of the rectangle, in degrees; 0-360",
"html_description": "<td>The clockwise rotation angle of the rectangle, in degrees; 0-360</td>",
"rst_description": "The clockwise rotation angle of the rectangle, in degrees; 0-360\n",
"name": "rotation_angle",
"required": true
},
{
"type": "Float",
"description": "The radius of the rectangle corner rounding, as a percentage of the media width",
"html_description": "<td>The radius of the rectangle corner rounding, as a percentage of the media width</td>",
"rst_description": "The radius of the rectangle corner rounding, as a percentage of the media width\n",
"name": "corner_radius_percentage",
"required": true
}
],
"category": "types"
}
}

View file

@ -0,0 +1,16 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "storyareatype",
"name": "StoryAreaType",
"description": "Describes the type of a clickable area on a story. Currently, it can be one of\n - StoryAreaTypeLocation\n - StoryAreaTypeSuggestedReaction\n - StoryAreaTypeLink\n - StoryAreaTypeWeather\n - StoryAreaTypeUniqueGift",
"html_description": "<p>Describes the type of a clickable area on a story. Currently, it can be one of</p><ul>\n<li><a href=\"#storyareatypelocation\">StoryAreaTypeLocation</a></li>\n<li><a href=\"#storyareatypesuggestedreaction\">StoryAreaTypeSuggestedReaction</a></li>\n<li><a href=\"#storyareatypelink\">StoryAreaTypeLink</a></li>\n<li><a href=\"#storyareatypeweather\">StoryAreaTypeWeather</a></li>\n<li><a href=\"#storyareatypeuniquegift\">StoryAreaTypeUniqueGift</a></li>\n</ul>",
"rst_description": "Describes the type of a clickable area on a story. Currently, it can be one of\n\n - :class:`aiogram.types.story_area_type_location.StoryAreaTypeLocation`\n - :class:`aiogram.types.story_area_type_suggested_reaction.StoryAreaTypeSuggestedReaction`\n - :class:`aiogram.types.story_area_type_link.StoryAreaTypeLink`\n - :class:`aiogram.types.story_area_type_weather.StoryAreaTypeWeather`\n - :class:`aiogram.types.story_area_type_unique_gift.StoryAreaTypeUniqueGift`",
"annotations": [],
"category": "types"
}
}

View file

@ -0,0 +1 @@
discriminator: "type"

View file

@ -0,0 +1,33 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "storyareatypelink",
"name": "StoryAreaTypeLink",
"description": "Describes a story area pointing to an HTTP or tg:// link. Currently, a story can have up to 3 link areas.",
"html_description": "<p>Describes a story area pointing to an HTTP or tg:// link. Currently, a story can have up to 3 link areas.</p>",
"rst_description": "Describes a story area pointing to an HTTP or tg:// link. Currently, a story can have up to 3 link areas.",
"annotations": [
{
"type": "String",
"description": "Type of the area, always 'link'",
"html_description": "<td>Type of the area, always &#8220;link&#8221;</td>",
"rst_description": "Type of the area, always 'link'\n",
"name": "type",
"required": true
},
{
"type": "String",
"description": "HTTP or tg:// URL to be opened when the area is clicked",
"html_description": "<td>HTTP or tg:// URL to be opened when the area is clicked</td>",
"rst_description": "HTTP or tg:// URL to be opened when the area is clicked\n",
"name": "url",
"required": true
}
],
"category": "types"
}
}

View file

@ -0,0 +1,49 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "storyareatypelocation",
"name": "StoryAreaTypeLocation",
"description": "Describes a story area pointing to a location. Currently, a story can have up to 10 location areas.",
"html_description": "<p>Describes a story area pointing to a location. Currently, a story can have up to 10 location areas.</p>",
"rst_description": "Describes a story area pointing to a location. Currently, a story can have up to 10 location areas.",
"annotations": [
{
"type": "String",
"description": "Type of the area, always 'location'",
"html_description": "<td>Type of the area, always &#8220;location&#8221;</td>",
"rst_description": "Type of the area, always 'location'\n",
"name": "type",
"required": true
},
{
"type": "Float",
"description": "Location latitude in degrees",
"html_description": "<td>Location latitude in degrees</td>",
"rst_description": "Location latitude in degrees\n",
"name": "latitude",
"required": true
},
{
"type": "Float",
"description": "Location longitude in degrees",
"html_description": "<td>Location longitude in degrees</td>",
"rst_description": "Location longitude in degrees\n",
"name": "longitude",
"required": true
},
{
"type": "LocationAddress",
"description": "Address of the location",
"html_description": "<td><em>Optional</em>. Address of the location</td>",
"rst_description": "*Optional*. Address of the location\n",
"name": "address",
"required": false
}
],
"category": "types"
}
}

View file

@ -0,0 +1,49 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "storyareatypesuggestedreaction",
"name": "StoryAreaTypeSuggestedReaction",
"description": "Describes a story area pointing to a suggested reaction. Currently, a story can have up to 5 suggested reaction areas.",
"html_description": "<p>Describes a story area pointing to a suggested reaction. Currently, a story can have up to 5 suggested reaction areas.</p>",
"rst_description": "Describes a story area pointing to a suggested reaction. Currently, a story can have up to 5 suggested reaction areas.",
"annotations": [
{
"type": "String",
"description": "Type of the area, always 'suggested_reaction'",
"html_description": "<td>Type of the area, always &#8220;suggested_reaction&#8221;</td>",
"rst_description": "Type of the area, always 'suggested_reaction'\n",
"name": "type",
"required": true
},
{
"type": "ReactionType",
"description": "Type of the reaction",
"html_description": "<td>Type of the reaction</td>",
"rst_description": "Type of the reaction\n",
"name": "reaction_type",
"required": true
},
{
"type": "Boolean",
"description": "Pass True if the reaction area has a dark background",
"html_description": "<td><em>Optional</em>. Pass <em>True</em> if the reaction area has a dark background</td>",
"rst_description": "*Optional*. Pass :code:`True` if the reaction area has a dark background\n",
"name": "is_dark",
"required": false
},
{
"type": "Boolean",
"description": "Pass True if reaction area corner is flipped",
"html_description": "<td><em>Optional</em>. Pass <em>True</em> if reaction area corner is flipped</td>",
"rst_description": "*Optional*. Pass :code:`True` if reaction area corner is flipped\n",
"name": "is_flipped",
"required": false
}
],
"category": "types"
}
}

View file

@ -0,0 +1,33 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "storyareatypeuniquegift",
"name": "StoryAreaTypeUniqueGift",
"description": "Describes a story area pointing to a unique gift. Currently, a story can have at most 1 unique gift area.",
"html_description": "<p>Describes a story area pointing to a unique gift. Currently, a story can have at most 1 unique gift area.</p>",
"rst_description": "Describes a story area pointing to a unique gift. Currently, a story can have at most 1 unique gift area.",
"annotations": [
{
"type": "String",
"description": "Type of the area, always 'unique_gift'",
"html_description": "<td>Type of the area, always &#8220;unique_gift&#8221;</td>",
"rst_description": "Type of the area, always 'unique_gift'\n",
"name": "type",
"required": true
},
{
"type": "String",
"description": "Unique name of the gift",
"html_description": "<td>Unique name of the gift</td>",
"rst_description": "Unique name of the gift\n",
"name": "name",
"required": true
}
],
"category": "types"
}
}

View file

@ -0,0 +1,49 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "storyareatypeweather",
"name": "StoryAreaTypeWeather",
"description": "Describes a story area containing weather information. Currently, a story can have up to 3 weather areas.",
"html_description": "<p>Describes a story area containing weather information. Currently, a story can have up to 3 weather areas.</p>",
"rst_description": "Describes a story area containing weather information. Currently, a story can have up to 3 weather areas.",
"annotations": [
{
"type": "String",
"description": "Type of the area, always 'weather'",
"html_description": "<td>Type of the area, always &#8220;weather&#8221;</td>",
"rst_description": "Type of the area, always 'weather'\n",
"name": "type",
"required": true
},
{
"type": "Float",
"description": "Temperature, in degree Celsius",
"html_description": "<td>Temperature, in degree Celsius</td>",
"rst_description": "Temperature, in degree Celsius\n",
"name": "temperature",
"required": true
},
{
"type": "String",
"description": "Emoji representing the weather",
"html_description": "<td>Emoji representing the weather</td>",
"rst_description": "Emoji representing the weather\n",
"name": "emoji",
"required": true
},
{
"type": "Integer",
"description": "A color of the area background in the ARGB format",
"html_description": "<td>A color of the area background in the ARGB format</td>",
"rst_description": "A color of the area background in the ARGB format\n",
"name": "background_color",
"required": true
}
],
"category": "types"
}
}

View file

@ -19,6 +19,14 @@
"name": "type", "name": "type",
"required": true "required": true
}, },
{
"type": "String",
"description": "Type of the transaction, currently one of 'invoice_payment' for payments via invoices, 'paid_media_payment' for payments for paid media, 'gift_purchase' for gifts sent by the bot, 'premium_purchase' for Telegram Premium subscriptions gifted by the bot, 'business_account_transfer' for direct transfers from managed business accounts",
"html_description": "<td>Type of the transaction, currently one of &#8220;invoice_payment&#8221; for payments via invoices, &#8220;paid_media_payment&#8221; for payments for paid media, &#8220;gift_purchase&#8221; for gifts sent by the bot, &#8220;premium_purchase&#8221; for Telegram Premium subscriptions gifted by the bot, &#8220;business_account_transfer&#8221; for direct transfers from managed business accounts</td>",
"rst_description": "Type of the transaction, currently one of 'invoice_payment' for payments via invoices, 'paid_media_payment' for payments for paid media, 'gift_purchase' for gifts sent by the bot, 'premium_purchase' for Telegram Premium subscriptions gifted by the bot, 'business_account_transfer' for direct transfers from managed business accounts\n",
"name": "transaction_type",
"required": true
},
{ {
"type": "User", "type": "User",
"description": "Information about the user", "description": "Information about the user",
@ -29,51 +37,59 @@
}, },
{ {
"type": "AffiliateInfo", "type": "AffiliateInfo",
"description": "Information about the affiliate that received a commission via this transaction", "description": "Information about the affiliate that received a commission via this transaction. Can be available only for 'invoice_payment' and 'paid_media_payment' transactions.",
"html_description": "<td><em>Optional</em>. Information about the affiliate that received a commission via this transaction</td>", "html_description": "<td><em>Optional</em>. Information about the affiliate that received a commission via this transaction. Can be available only for &#8220;invoice_payment&#8221; and &#8220;paid_media_payment&#8221; transactions.</td>",
"rst_description": "*Optional*. Information about the affiliate that received a commission via this transaction\n", "rst_description": "*Optional*. Information about the affiliate that received a commission via this transaction. Can be available only for 'invoice_payment' and 'paid_media_payment' transactions.\n",
"name": "affiliate", "name": "affiliate",
"required": false "required": false
}, },
{ {
"type": "String", "type": "String",
"description": "Bot-specified invoice payload", "description": "Bot-specified invoice payload. Can be available only for 'invoice_payment' transactions.",
"html_description": "<td><em>Optional</em>. Bot-specified invoice payload</td>", "html_description": "<td><em>Optional</em>. Bot-specified invoice payload. Can be available only for &#8220;invoice_payment&#8221; transactions.</td>",
"rst_description": "*Optional*. Bot-specified invoice payload\n", "rst_description": "*Optional*. Bot-specified invoice payload. Can be available only for 'invoice_payment' transactions.\n",
"name": "invoice_payload", "name": "invoice_payload",
"required": false "required": false
}, },
{ {
"type": "Integer", "type": "Integer",
"description": "The duration of the paid subscription", "description": "The duration of the paid subscription. Can be available only for 'invoice_payment' transactions.",
"html_description": "<td><em>Optional</em>. The duration of the paid subscription</td>", "html_description": "<td><em>Optional</em>. The duration of the paid subscription. Can be available only for &#8220;invoice_payment&#8221; transactions.</td>",
"rst_description": "*Optional*. The duration of the paid subscription\n", "rst_description": "*Optional*. The duration of the paid subscription. Can be available only for 'invoice_payment' transactions.\n",
"name": "subscription_period", "name": "subscription_period",
"required": false "required": false
}, },
{ {
"type": "Array of PaidMedia", "type": "Array of PaidMedia",
"description": "Information about the paid media bought by the user", "description": "Information about the paid media bought by the user; for 'paid_media_payment' transactions only",
"html_description": "<td><em>Optional</em>. Information about the paid media bought by the user</td>", "html_description": "<td><em>Optional</em>. Information about the paid media bought by the user; for &#8220;paid_media_payment&#8221; transactions only</td>",
"rst_description": "*Optional*. Information about the paid media bought by the user\n", "rst_description": "*Optional*. Information about the paid media bought by the user; for 'paid_media_payment' transactions only\n",
"name": "paid_media", "name": "paid_media",
"required": false "required": false
}, },
{ {
"type": "String", "type": "String",
"description": "Bot-specified paid media payload", "description": "Bot-specified paid media payload. Can be available only for 'paid_media_payment' transactions.",
"html_description": "<td><em>Optional</em>. Bot-specified paid media payload</td>", "html_description": "<td><em>Optional</em>. Bot-specified paid media payload. Can be available only for &#8220;paid_media_payment&#8221; transactions.</td>",
"rst_description": "*Optional*. Bot-specified paid media payload\n", "rst_description": "*Optional*. Bot-specified paid media payload. Can be available only for 'paid_media_payment' transactions.\n",
"name": "paid_media_payload", "name": "paid_media_payload",
"required": false "required": false
}, },
{ {
"type": "Gift", "type": "Gift",
"description": "The gift sent to the user by the bot", "description": "The gift sent to the user by the bot; for 'gift_purchase' transactions only",
"html_description": "<td><em>Optional</em>. The gift sent to the user by the bot</td>", "html_description": "<td><em>Optional</em>. The gift sent to the user by the bot; for &#8220;gift_purchase&#8221; transactions only</td>",
"rst_description": "*Optional*. The gift sent to the user by the bot\n", "rst_description": "*Optional*. The gift sent to the user by the bot; for 'gift_purchase' transactions only\n",
"name": "gift", "name": "gift",
"required": false "required": false
},
{
"type": "Integer",
"description": "Number of months the gifted Telegram Premium subscription will be active for; for 'premium_purchase' transactions only",
"html_description": "<td><em>Optional</em>. Number of months the gifted Telegram Premium subscription will be active for; for &#8220;premium_purchase&#8221; transactions only</td>",
"rst_description": "*Optional*. Number of months the gifted Telegram Premium subscription will be active for; for 'premium_purchase' transactions only\n",
"name": "premium_subscription_duration",
"required": false
} }
], ],
"category": "types" "category": "types"

View file

@ -0,0 +1,65 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "uniquegift",
"name": "UniqueGift",
"description": "This object describes a unique gift that was upgraded from a regular gift.",
"html_description": "<p>This object describes a unique gift that was upgraded from a regular gift.</p>",
"rst_description": "This object describes a unique gift that was upgraded from a regular gift.",
"annotations": [
{
"type": "String",
"description": "Human-readable name of the regular gift from which this unique gift was upgraded",
"html_description": "<td>Human-readable name of the regular gift from which this unique gift was upgraded</td>",
"rst_description": "Human-readable name of the regular gift from which this unique gift was upgraded\n",
"name": "base_name",
"required": true
},
{
"type": "String",
"description": "Unique name of the gift. This name can be used in https://t.me/nft/... links and story areas",
"html_description": "<td>Unique name of the gift. This name can be used in <code>https://t.me/nft/...</code> links and story areas</td>",
"rst_description": "Unique name of the gift. This name can be used in :code:`https://t.me/nft/...` links and story areas\n",
"name": "name",
"required": true
},
{
"type": "Integer",
"description": "Unique number of the upgraded gift among gifts upgraded from the same regular gift",
"html_description": "<td>Unique number of the upgraded gift among gifts upgraded from the same regular gift</td>",
"rst_description": "Unique number of the upgraded gift among gifts upgraded from the same regular gift\n",
"name": "number",
"required": true
},
{
"type": "UniqueGiftModel",
"description": "Model of the gift",
"html_description": "<td>Model of the gift</td>",
"rst_description": "Model of the gift\n",
"name": "model",
"required": true
},
{
"type": "UniqueGiftSymbol",
"description": "Symbol of the gift",
"html_description": "<td>Symbol of the gift</td>",
"rst_description": "Symbol of the gift\n",
"name": "symbol",
"required": true
},
{
"type": "UniqueGiftBackdrop",
"description": "Backdrop of the gift",
"html_description": "<td>Backdrop of the gift</td>",
"rst_description": "Backdrop of the gift\n",
"name": "backdrop",
"required": true
}
],
"category": "types"
}
}

View file

@ -0,0 +1,41 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "uniquegiftbackdrop",
"name": "UniqueGiftBackdrop",
"description": "This object describes the backdrop of a unique gift.",
"html_description": "<p>This object describes the backdrop of a unique gift.</p>",
"rst_description": "This object describes the backdrop of a unique gift.",
"annotations": [
{
"type": "String",
"description": "Name of the backdrop",
"html_description": "<td>Name of the backdrop</td>",
"rst_description": "Name of the backdrop\n",
"name": "name",
"required": true
},
{
"type": "UniqueGiftBackdropColors",
"description": "Colors of the backdrop",
"html_description": "<td>Colors of the backdrop</td>",
"rst_description": "Colors of the backdrop\n",
"name": "colors",
"required": true
},
{
"type": "Integer",
"description": "The number of unique gifts that receive this backdrop for every 1000 gifts upgraded",
"html_description": "<td>The number of unique gifts that receive this backdrop for every 1000 gifts upgraded</td>",
"rst_description": "The number of unique gifts that receive this backdrop for every 1000 gifts upgraded\n",
"name": "rarity_per_mille",
"required": true
}
],
"category": "types"
}
}

View file

@ -0,0 +1,49 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "uniquegiftbackdropcolors",
"name": "UniqueGiftBackdropColors",
"description": "This object describes the colors of the backdrop of a unique gift.",
"html_description": "<p>This object describes the colors of the backdrop of a unique gift.</p>",
"rst_description": "This object describes the colors of the backdrop of a unique gift.",
"annotations": [
{
"type": "Integer",
"description": "The color in the center of the backdrop in RGB format",
"html_description": "<td>The color in the center of the backdrop in RGB format</td>",
"rst_description": "The color in the center of the backdrop in RGB format\n",
"name": "center_color",
"required": true
},
{
"type": "Integer",
"description": "The color on the edges of the backdrop in RGB format",
"html_description": "<td>The color on the edges of the backdrop in RGB format</td>",
"rst_description": "The color on the edges of the backdrop in RGB format\n",
"name": "edge_color",
"required": true
},
{
"type": "Integer",
"description": "The color to be applied to the symbol in RGB format",
"html_description": "<td>The color to be applied to the symbol in RGB format</td>",
"rst_description": "The color to be applied to the symbol in RGB format\n",
"name": "symbol_color",
"required": true
},
{
"type": "Integer",
"description": "The color for the text on the backdrop in RGB format",
"html_description": "<td>The color for the text on the backdrop in RGB format</td>",
"rst_description": "The color for the text on the backdrop in RGB format\n",
"name": "text_color",
"required": true
}
],
"category": "types"
}
}

View file

@ -0,0 +1,49 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "uniquegiftinfo",
"name": "UniqueGiftInfo",
"description": "Describes a service message about a unique gift that was sent or received.",
"html_description": "<p>Describes a service message about a unique gift that was sent or received.</p>",
"rst_description": "Describes a service message about a unique gift that was sent or received.",
"annotations": [
{
"type": "UniqueGift",
"description": "Information about the gift",
"html_description": "<td>Information about the gift</td>",
"rst_description": "Information about the gift\n",
"name": "gift",
"required": true
},
{
"type": "String",
"description": "Origin of the gift. Currently, either 'upgrade' or 'transfer'",
"html_description": "<td>Origin of the gift. Currently, either &#8220;upgrade&#8221; or &#8220;transfer&#8221;</td>",
"rst_description": "Origin of the gift. Currently, either 'upgrade' or 'transfer'\n",
"name": "origin",
"required": true
},
{
"type": "String",
"description": "Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts",
"html_description": "<td><em>Optional</em>. Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts</td>",
"rst_description": "*Optional*. Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts\n",
"name": "owned_gift_id",
"required": false
},
{
"type": "Integer",
"description": "Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift",
"html_description": "<td><em>Optional</em>. Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift</td>",
"rst_description": "*Optional*. Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift\n",
"name": "transfer_star_count",
"required": false
}
],
"category": "types"
}
}

View file

@ -0,0 +1,41 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "uniquegiftmodel",
"name": "UniqueGiftModel",
"description": "This object describes the model of a unique gift.",
"html_description": "<p>This object describes the model of a unique gift.</p>",
"rst_description": "This object describes the model of a unique gift.",
"annotations": [
{
"type": "String",
"description": "Name of the model",
"html_description": "<td>Name of the model</td>",
"rst_description": "Name of the model\n",
"name": "name",
"required": true
},
{
"type": "Sticker",
"description": "The sticker that represents the unique gift",
"html_description": "<td>The sticker that represents the unique gift</td>",
"rst_description": "The sticker that represents the unique gift\n",
"name": "sticker",
"required": true
},
{
"type": "Integer",
"description": "The number of unique gifts that receive this model for every 1000 gifts upgraded",
"html_description": "<td>The number of unique gifts that receive this model for every 1000 gifts upgraded</td>",
"rst_description": "The number of unique gifts that receive this model for every 1000 gifts upgraded\n",
"name": "rarity_per_mille",
"required": true
}
],
"category": "types"
}
}

View file

@ -0,0 +1,41 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "uniquegiftsymbol",
"name": "UniqueGiftSymbol",
"description": "This object describes the symbol shown on the pattern of a unique gift.",
"html_description": "<p>This object describes the symbol shown on the pattern of a unique gift.</p>",
"rst_description": "This object describes the symbol shown on the pattern of a unique gift.",
"annotations": [
{
"type": "String",
"description": "Name of the symbol",
"html_description": "<td>Name of the symbol</td>",
"rst_description": "Name of the symbol\n",
"name": "name",
"required": true
},
{
"type": "Sticker",
"description": "The sticker that represents the unique gift",
"html_description": "<td>The sticker that represents the unique gift</td>",
"rst_description": "The sticker that represents the unique gift\n",
"name": "sticker",
"required": true
},
{
"type": "Integer",
"description": "The number of unique gifts that receive this model for every 1000 gifts upgraded",
"html_description": "<td>The number of unique gifts that receive this model for every 1000 gifts upgraded</td>",
"rst_description": "The number of unique gifts that receive this model for every 1000 gifts upgraded\n",
"name": "rarity_per_mille",
"required": true
}
],
"category": "types"
}
}

107
CHANGES/1671.feature.rst Normal file
View file

@ -0,0 +1,107 @@
Added full support for the `Bot API 9.0 <https://core.telegram.org/bots/api-changelog#april-11-2025>`_:
**Business Accounts**
- Added the class :class:`aiogram.types.business_bot_rights.BusinessBotRights` and replaced
the field :code:`can_reply` with the field :code:`rights` of the type
:class:`aiogram.types.business_bot_rights.BusinessBotRights` in the class
:class:`aiogram.types.business_connection.BusinessConnection`.
- Added the method :class:`aiogram.methods.read_business_message.ReadBusinessMessage`,
allowing bots to mark incoming messages as read on behalf of a business account.
- Added the method :class:`aiogram.methods.delete_business_messages.DeleteBusinessMessages`,
allowing bots to delete messages on behalf of a business account.
- Added the method :class:`aiogram.methods.set_business_account_name.SetBusinessAccountName`,
allowing bots to change the first and last name of a managed business account.
- Added the method :class:`aiogram.methods.set_business_account_username.SetBusinessAccountUsername`,
allowing bots to change the username of a managed business account.
- Added the method :class:`aiogram.methods.set_business_account_bio.SetBusinessAccountBio`,
allowing bots to change the bio of a managed business account.
- Added the class :class:`aiogram.types.input_profile_photo.InputProfilePhoto`,
describing a profile photo to be set.
- Added the methods :class:`aiogram.methods.set_business_account_profile_photo.SetBusinessAccountProfilePhoto`
and :class:`aiogram.methods.remove_business_account_profile_photo.RemoveBusinessAccountProfilePhoto`,
allowing bots to change the profile photo of a managed business account.
- Added the method :class:`aiogram.methods.set_business_account_gift_settings.SetBusinessAccountGiftSettings`,
allowing bots to change the privacy settings pertaining to incoming gifts in a managed business account.
- Added the class :class:`aiogram.types.star_amount.StarAmount` and the method
:class:`aiogram.methods.get_business_account_star_balance.GetBusinessAccountStarBalance`,
allowing bots to check the current Telegram Star balance of a managed business account.
- Added the method :class:`aiogram.methods.transfer_business_account_stars.TransferBusinessAccountStars`,
allowing bots to transfer Telegram Stars from the balance of a managed business account to their own balance
for withdrawal.
- Added the classes :class:`aiogram.types.owned_gift_regular.OwnedGiftRegular`,
:class:`aiogram.types.owned_gift_unique.OwnedGiftUnique`, :class:`aiogram.types.owned_gifts.OwnedGifts`
and the method :class:`aiogram.methods.get_business_account_gifts.GetBusinessAccountGifts`,
allowing bots to fetch the list of gifts owned by a managed business account.
- Added the method :class:`aiogram.methods.convert_gift_to_stars.ConvertGiftToStars`,
allowing bots to convert gifts received by a managed business account to Telegram Stars.
- Added the method :class:`aiogram.methods.upgrade_gift.UpgradeGift`,
allowing bots to upgrade regular gifts received by a managed business account to unique gifts.
- Added the method :class:`aiogram.methods.transfer_gift.TransferGift`,
allowing bots to transfer unique gifts owned by a managed business account.
- Added the classes :class:`aiogram.types.input_story_content_photo.InputStoryContentPhoto`
and :class:`aiogram.types.input_story_content_video.InputStoryContentVideo`
representing the content of a story to post.
- Added the classes :class:`aiogram.types.story_area.StoryArea`,
:class:`aiogram.types.story_area_position.StoryAreaPosition`,
:class:`aiogram.types.location_address.LocationAddress`,
:class:`aiogram.types.story_area_type_location.StoryAreaTypeLocation`,
:class:`aiogram.types.story_area_type_suggested_reaction.StoryAreaTypeSuggestedReaction`,
:class:`aiogram.types.story_area_type_link.StoryAreaTypeLink`,
:class:`aiogram.types.story_area_type_weather.StoryAreaTypeWeather`
and :class:`aiogram.types.story_area_type_unique_gift.StoryAreaTypeUniqueGift`,
describing clickable active areas on stories.
- Added the methods :class:`aiogram.methods.post_story.PostStory`,
:class:`aiogram.methods.edit_story.EditStory`
and :class:`aiogram.methods.delete_story.DeleteStory`,
allowing bots to post, edit and delete stories on behalf of a managed business account.
**Mini Apps**
- Added the field :code:`DeviceStorage`, allowing Mini Apps to use persistent
local storage on the user's device.
- Added the field :code:`SecureStorage`, allowing Mini Apps to use a secure local
storage on the user's device for sensitive data.
**Gifts**
- Added the classes :class:`aiogram.types.unique_gift_model.UniqueGiftModel`,
:class:`aiogram.types.unique_gift_symbol.UniqueGiftSymbol`,
:class:`aiogram.types.unique_gift_backdrop_colors.UniqueGiftBackdropColors`,
and :class:`aiogram.types.unique_gift_backdrop.UniqueGiftBackdrop`
to describe the properties of a unique gift.
- Added the class :class:`aiogram.types.unique_gift.UniqueGift` describing
a gift that was upgraded to a unique one.
- Added the class :class:`aiogram.types.accepted_gift_types.AcceptedGiftTypes`
describing the types of gifts that are accepted by a user or a chat.
- Replaced the field :code:`can_send_gift` with the field :code:`accepted_gift_types`
of the type :class:`aiogram.types.accepted_gift_types.AcceptedGiftTypes`
in the class :class:`aiogram.types.chat_full_info.ChatFullInfo`.
- Added the class :class:`aiogram.types.gift_info.GiftInfo` and the field :code:`gift`
to the class :class:`aiogram.types.message.Message`,
describing a service message about a regular gift that was sent or received.
- Added the class :class:`aiogram.types.unique_gift_info.UniqueGiftInfo`
and the field :code:`unique_gift` to the class :class:`aiogram.types.message.Message`,
describing a service message about a unique gift that was sent or received.
**Telegram Premium**
- Added the method :class:`aiogram.methods.gift_premium_subscription.GiftPremiumSubscription`,
allowing bots to gift a user a Telegram Premium subscription paid in Telegram Stars.
- Added the field :code:`premium_subscription_duration` to the class
:class:`aiogram.types.transaction_partner_user.TransactionPartnerUser`
for transactions involving a Telegram Premium subscription purchased by the bot.
- Added the field :code:`transaction_type` to the class
:class:`aiogram.types.transaction_partner_user.TransactionPartnerUser`,
simplifying the differentiation and processing of all transaction types.
**General**
- Increased the maximum price for paid media to 10000 Telegram Stars.
- Increased the maximum price for a subscription period to 10000 Telegram Stars.
- Added the class :class:`aiogram.types.paid_message_price_changed.PaidMessagePriceChanged`
and the field :code:`paid_message_price_changed` to the class
:class:`aiogram.types.message.Message`, describing a service message about a price change
for paid messages sent to the chat.
- Added the field :code:`paid_star_count` to the class :class:`aiogram.types.message.Message`,
containing the number of Telegram Stars that were paid to send the message.

View file

@ -52,7 +52,7 @@ Features
- Asynchronous (`asyncio docs <https://docs.python.org/3/library/asyncio.html>`_, :pep:`492`) - Asynchronous (`asyncio docs <https://docs.python.org/3/library/asyncio.html>`_, :pep:`492`)
- Has type hints (:pep:`484`) and can be used with `mypy <http://mypy-lang.org/>`_ - Has type hints (:pep:`484`) and can be used with `mypy <http://mypy-lang.org/>`_
- Supports `PyPy <https://www.pypy.org/>`_ - Supports `PyPy <https://www.pypy.org/>`_
- Supports `Telegram Bot API 8.3 <https://core.telegram.org/bots/api>`_ and gets fast updates to the latest versions of the Bot API - Supports `Telegram Bot API 9.0 <https://core.telegram.org/bots/api>`_ and gets fast updates to the latest versions of the Bot API
- Telegram Bot API integration code was `autogenerated <https://github.com/aiogram/tg-codegen>`_ and can be easily re-generated when API gets updated - Telegram Bot API integration code was `autogenerated <https://github.com/aiogram/tg-codegen>`_ and can be easily re-generated when API gets updated
- Updates router (Blueprints) - Updates router (Blueprints)
- Has Finite State Machine - Has Finite State Machine

View file

@ -1,2 +1,2 @@
__version__ = "3.19.0" __version__ = "3.19.0"
__api_version__ = "8.3" __api_version__ = "9.0"

View file

@ -33,6 +33,7 @@ from ..methods import (
Close, Close,
CloseForumTopic, CloseForumTopic,
CloseGeneralForumTopic, CloseGeneralForumTopic,
ConvertGiftToStars,
CopyMessage, CopyMessage,
CopyMessages, CopyMessages,
CreateChatInviteLink, CreateChatInviteLink,
@ -41,6 +42,7 @@ from ..methods import (
CreateInvoiceLink, CreateInvoiceLink,
CreateNewStickerSet, CreateNewStickerSet,
DeclineChatJoinRequest, DeclineChatJoinRequest,
DeleteBusinessMessages,
DeleteChatPhoto, DeleteChatPhoto,
DeleteChatStickerSet, DeleteChatStickerSet,
DeleteForumTopic, DeleteForumTopic,
@ -49,6 +51,7 @@ from ..methods import (
DeleteMyCommands, DeleteMyCommands,
DeleteStickerFromSet, DeleteStickerFromSet,
DeleteStickerSet, DeleteStickerSet,
DeleteStory,
DeleteWebhook, DeleteWebhook,
EditChatInviteLink, EditChatInviteLink,
EditChatSubscriptionInviteLink, EditChatSubscriptionInviteLink,
@ -59,11 +62,14 @@ from ..methods import (
EditMessageMedia, EditMessageMedia,
EditMessageReplyMarkup, EditMessageReplyMarkup,
EditMessageText, EditMessageText,
EditStory,
EditUserStarSubscription, EditUserStarSubscription,
ExportChatInviteLink, ExportChatInviteLink,
ForwardMessage, ForwardMessage,
ForwardMessages, ForwardMessages,
GetAvailableGifts, GetAvailableGifts,
GetBusinessAccountGifts,
GetBusinessAccountStarBalance,
GetBusinessConnection, GetBusinessConnection,
GetChat, GetChat,
GetChatAdministrators, GetChatAdministrators,
@ -86,12 +92,16 @@ from ..methods import (
GetUserChatBoosts, GetUserChatBoosts,
GetUserProfilePhotos, GetUserProfilePhotos,
GetWebhookInfo, GetWebhookInfo,
GiftPremiumSubscription,
HideGeneralForumTopic, HideGeneralForumTopic,
LeaveChat, LeaveChat,
LogOut, LogOut,
PinChatMessage, PinChatMessage,
PostStory,
PromoteChatMember, PromoteChatMember,
ReadBusinessMessage,
RefundStarPayment, RefundStarPayment,
RemoveBusinessAccountProfilePhoto,
RemoveChatVerification, RemoveChatVerification,
RemoveUserVerification, RemoveUserVerification,
ReopenForumTopic, ReopenForumTopic,
@ -120,6 +130,11 @@ from ..methods import (
SendVideo, SendVideo,
SendVideoNote, SendVideoNote,
SendVoice, SendVoice,
SetBusinessAccountBio,
SetBusinessAccountGiftSettings,
SetBusinessAccountName,
SetBusinessAccountProfilePhoto,
SetBusinessAccountUsername,
SetChatAdministratorCustomTitle, SetChatAdministratorCustomTitle,
SetChatDescription, SetChatDescription,
SetChatMenuButton, SetChatMenuButton,
@ -147,6 +162,8 @@ from ..methods import (
StopMessageLiveLocation, StopMessageLiveLocation,
StopPoll, StopPoll,
TelegramMethod, TelegramMethod,
TransferBusinessAccountStars,
TransferGift,
UnbanChatMember, UnbanChatMember,
UnbanChatSenderChat, UnbanChatSenderChat,
UnhideGeneralForumTopic, UnhideGeneralForumTopic,
@ -154,11 +171,13 @@ from ..methods import (
UnpinAllForumTopicMessages, UnpinAllForumTopicMessages,
UnpinAllGeneralForumTopicMessages, UnpinAllGeneralForumTopicMessages,
UnpinChatMessage, UnpinChatMessage,
UpgradeGift,
UploadStickerFile, UploadStickerFile,
VerifyChat, VerifyChat,
VerifyUser, VerifyUser,
) )
from ..types import ( from ..types import (
AcceptedGiftTypes,
BotCommand, BotCommand,
BotCommandScopeUnion, BotCommandScopeUnion,
BotDescription, BotDescription,
@ -184,7 +203,9 @@ from ..types import (
InputMediaUnion, InputMediaUnion,
InputPaidMediaUnion, InputPaidMediaUnion,
InputPollOptionUnion, InputPollOptionUnion,
InputProfilePhotoUnion,
InputSticker, InputSticker,
InputStoryContentUnion,
LabeledPrice, LabeledPrice,
LinkPreviewOptions, LinkPreviewOptions,
MaskPosition, MaskPosition,
@ -193,6 +214,7 @@ from ..types import (
Message, Message,
MessageEntity, MessageEntity,
MessageId, MessageId,
OwnedGifts,
PassportElementErrorUnion, PassportElementErrorUnion,
Poll, Poll,
PreparedInlineMessage, PreparedInlineMessage,
@ -203,9 +225,12 @@ from ..types import (
ResultMenuButtonUnion, ResultMenuButtonUnion,
SentWebAppMessage, SentWebAppMessage,
ShippingOption, ShippingOption,
StarAmount,
StarTransactions, StarTransactions,
Sticker, Sticker,
StickerSet, StickerSet,
Story,
StoryArea,
Update, Update,
User, User,
UserChatBoosts, UserChatBoosts,
@ -932,7 +957,7 @@ class Bot:
:param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars <https://t.me/BotNews/90>`_. :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars <https://t.me/BotNews/90>`_.
:param business_connection_id: Unique identifier of the business connection on behalf of which the link will be created. For payments in `Telegram Stars <https://t.me/BotNews/90>`_ only. :param business_connection_id: Unique identifier of the business connection on behalf of which the link will be created. For payments in `Telegram Stars <https://t.me/BotNews/90>`_ only.
:param provider_token: Payment provider token, obtained via `@BotFather <https://t.me/botfather>`_. Pass an empty string for payments in `Telegram Stars <https://t.me/BotNews/90>`_. :param provider_token: Payment provider token, obtained via `@BotFather <https://t.me/botfather>`_. Pass an empty string for payments in `Telegram Stars <https://t.me/BotNews/90>`_.
:param subscription_period: The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 2500 Telegram Stars. :param subscription_period: The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 10000 Telegram Stars.
:param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json <https://core.telegram.org/bots/payments/currencies.json>`_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars <https://t.me/BotNews/90>`_. :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json <https://core.telegram.org/bots/payments/currencies.json>`_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars <https://t.me/BotNews/90>`_.
:param suggested_tip_amounts: A JSON-serialized array of suggested amounts of tips in the *smallest units* of the currency (integer, **not** float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed *max_tip_amount*. :param suggested_tip_amounts: A JSON-serialized array of suggested amounts of tips in the *smallest units* of the currency (integer, **not** float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed *max_tip_amount*.
:param provider_data: JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider. :param provider_data: JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.
@ -4571,7 +4596,7 @@ class Bot:
Source: https://core.telegram.org/bots/api#sendpaidmedia Source: https://core.telegram.org/bots/api#sendpaidmedia
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`). If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance. :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`). If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance.
:param star_count: The number of Telegram Stars that must be paid to buy access to the media; 1-2500 :param star_count: The number of Telegram Stars that must be paid to buy access to the media; 1-10000
:param media: A JSON-serialized array describing the media to be sent; up to 10 items :param media: A JSON-serialized array describing the media to be sent; up to 10 items
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
:param payload: Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user, use it for your internal processes. :param payload: Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user, use it for your internal processes.
@ -4621,7 +4646,7 @@ class Bot:
:param chat_id: Unique identifier for the target channel chat or username of the target channel (in the format :code:`@channelusername`) :param chat_id: Unique identifier for the target channel chat or username of the target channel (in the format :code:`@channelusername`)
:param subscription_period: The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days). :param subscription_period: The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days).
:param subscription_price: The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500 :param subscription_price: The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-10000
:param name: Invite link name; 0-32 characters :param name: Invite link name; 0-32 characters
:param request_timeout: Request timeout :param request_timeout: Request timeout
:return: Returns the new invite link as a :class:`aiogram.types.chat_invite_link.ChatInviteLink` object. :return: Returns the new invite link as a :class:`aiogram.types.chat_invite_link.ChatInviteLink` object.
@ -4758,7 +4783,7 @@ class Bot:
:param user_id: Required if *chat_id* is not specified. Unique identifier of the target user who will receive the gift. :param user_id: Required if *chat_id* is not specified. Unique identifier of the target user who will receive the gift.
:param chat_id: Required if *user_id* is not specified. Unique identifier for the chat or username of the channel (in the format :code:`@channelusername`) that will receive the gift. :param chat_id: Required if *user_id* is not specified. Unique identifier for the chat or username of the channel (in the format :code:`@channelusername`) that will receive the gift.
:param pay_for_upgrade: Pass :code:`True` to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver :param pay_for_upgrade: Pass :code:`True` to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver
:param text: Text that will be shown along with the gift; 0-255 characters :param text: Text that will be shown along with the gift; 0-128 characters
:param text_parse_mode: Mode for parsing entities in the text. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored. :param text_parse_mode: Mode for parsing entities in the text. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.
:param text_entities: A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of *text_parse_mode*. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored. :param text_entities: A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of *text_parse_mode*. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.
:param request_timeout: Request timeout :param request_timeout: Request timeout
@ -4887,3 +4912,507 @@ class Bot:
custom_description=custom_description, custom_description=custom_description,
) )
return await self(call, request_timeout=request_timeout) return await self(call, request_timeout=request_timeout)
async def convert_gift_to_stars(
self,
business_connection_id: str,
owned_gift_id: str,
request_timeout: Optional[int] = None,
) -> bool:
"""
Converts a given regular gift to Telegram Stars. Requires the *can_convert_gifts_to_stars* business bot right. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#convertgifttostars
:param business_connection_id: Unique identifier of the business connection
:param owned_gift_id: Unique identifier of the regular gift that should be converted to Telegram Stars
:param request_timeout: Request timeout
:return: Returns :code:`True` on success.
"""
call = ConvertGiftToStars(
business_connection_id=business_connection_id,
owned_gift_id=owned_gift_id,
)
return await self(call, request_timeout=request_timeout)
async def delete_business_messages(
self,
business_connection_id: str,
message_ids: list[int],
request_timeout: Optional[int] = None,
) -> bool:
"""
Delete messages on behalf of a business account. Requires the *can_delete_outgoing_messages* business bot right to delete messages sent by the bot itself, or the *can_delete_all_messages* business bot right to delete any message. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#deletebusinessmessages
:param business_connection_id: Unique identifier of the business connection on behalf of which to delete the messages
:param message_ids: A JSON-serialized list of 1-100 identifiers of messages to delete. All messages must be from the same chat. See :class:`aiogram.methods.delete_message.DeleteMessage` for limitations on which messages can be deleted
:param request_timeout: Request timeout
:return: Returns :code:`True` on success.
"""
call = DeleteBusinessMessages(
business_connection_id=business_connection_id,
message_ids=message_ids,
)
return await self(call, request_timeout=request_timeout)
async def delete_story(
self,
business_connection_id: str,
story_id: int,
request_timeout: Optional[int] = None,
) -> bool:
"""
Deletes a story previously posted by the bot on behalf of a managed business account. Requires the *can_manage_stories* business bot right. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#deletestory
:param business_connection_id: Unique identifier of the business connection
:param story_id: Unique identifier of the story to delete
:param request_timeout: Request timeout
:return: Returns :code:`True` on success.
"""
call = DeleteStory(
business_connection_id=business_connection_id,
story_id=story_id,
)
return await self(call, request_timeout=request_timeout)
async def edit_story(
self,
business_connection_id: str,
story_id: int,
content: InputStoryContentUnion,
caption: Optional[str] = None,
parse_mode: Optional[str] = None,
caption_entities: Optional[list[MessageEntity]] = None,
areas: Optional[list[StoryArea]] = None,
request_timeout: Optional[int] = None,
) -> Story:
"""
Edits a story previously posted by the bot on behalf of a managed business account. Requires the *can_manage_stories* business bot right. Returns :class:`aiogram.types.story.Story` on success.
Source: https://core.telegram.org/bots/api#editstory
:param business_connection_id: Unique identifier of the business connection
:param story_id: Unique identifier of the story to edit
:param content: Content of the story
:param caption: Caption of the story, 0-2048 characters after entities parsing
:param parse_mode: Mode for parsing entities in the story caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
:param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*
:param areas: A JSON-serialized list of clickable areas to be shown on the story
:param request_timeout: Request timeout
:return: Returns :class:`aiogram.types.story.Story` on success.
"""
call = EditStory(
business_connection_id=business_connection_id,
story_id=story_id,
content=content,
caption=caption,
parse_mode=parse_mode,
caption_entities=caption_entities,
areas=areas,
)
return await self(call, request_timeout=request_timeout)
async def get_business_account_gifts(
self,
business_connection_id: str,
exclude_unsaved: Optional[bool] = None,
exclude_saved: Optional[bool] = None,
exclude_unlimited: Optional[bool] = None,
exclude_limited: Optional[bool] = None,
exclude_unique: Optional[bool] = None,
sort_by_price: Optional[bool] = None,
offset: Optional[str] = None,
limit: Optional[int] = None,
request_timeout: Optional[int] = None,
) -> OwnedGifts:
"""
Returns the gifts received and owned by a managed business account. Requires the *can_view_gifts_and_stars* business bot right. Returns :class:`aiogram.types.owned_gifts.OwnedGifts` on success.
Source: https://core.telegram.org/bots/api#getbusinessaccountgifts
:param business_connection_id: Unique identifier of the business connection
:param exclude_unsaved: Pass True to exclude gifts that aren't saved to the account's profile page
:param exclude_saved: Pass True to exclude gifts that are saved to the account's profile page
:param exclude_unlimited: Pass True to exclude gifts that can be purchased an unlimited number of times
:param exclude_limited: Pass True to exclude gifts that can be purchased a limited number of times
:param exclude_unique: Pass True to exclude unique gifts
:param sort_by_price: Pass True to sort results by gift price instead of send date. Sorting is applied before pagination.
:param offset: Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
:param limit: The maximum number of gifts to be returned; 1-100. Defaults to 100
:param request_timeout: Request timeout
:return: Returns :class:`aiogram.types.owned_gifts.OwnedGifts` on success.
"""
call = GetBusinessAccountGifts(
business_connection_id=business_connection_id,
exclude_unsaved=exclude_unsaved,
exclude_saved=exclude_saved,
exclude_unlimited=exclude_unlimited,
exclude_limited=exclude_limited,
exclude_unique=exclude_unique,
sort_by_price=sort_by_price,
offset=offset,
limit=limit,
)
return await self(call, request_timeout=request_timeout)
async def get_business_account_star_balance(
self,
business_connection_id: str,
request_timeout: Optional[int] = None,
) -> StarAmount:
"""
Returns the amount of Telegram Stars owned by a managed business account. Requires the *can_view_gifts_and_stars* business bot right. Returns :class:`aiogram.types.star_amount.StarAmount` on success.
Source: https://core.telegram.org/bots/api#getbusinessaccountstarbalance
:param business_connection_id: Unique identifier of the business connection
:param request_timeout: Request timeout
:return: Returns :class:`aiogram.types.star_amount.StarAmount` on success.
"""
call = GetBusinessAccountStarBalance(
business_connection_id=business_connection_id,
)
return await self(call, request_timeout=request_timeout)
async def gift_premium_subscription(
self,
user_id: int,
month_count: int,
star_count: int,
text: Optional[str] = None,
text_parse_mode: Optional[str] = None,
text_entities: Optional[list[MessageEntity]] = None,
request_timeout: Optional[int] = None,
) -> bool:
"""
Gifts a Telegram Premium subscription to the given user. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#giftpremiumsubscription
:param user_id: Unique identifier of the target user who will receive a Telegram Premium subscription
:param month_count: Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12
:param star_count: Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months
:param text: Text that will be shown along with the service message about the subscription; 0-128 characters
:param text_parse_mode: Mode for parsing entities in the text. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.
:param text_entities: A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of *text_parse_mode*. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.
:param request_timeout: Request timeout
:return: Returns :code:`True` on success.
"""
call = GiftPremiumSubscription(
user_id=user_id,
month_count=month_count,
star_count=star_count,
text=text,
text_parse_mode=text_parse_mode,
text_entities=text_entities,
)
return await self(call, request_timeout=request_timeout)
async def post_story(
self,
business_connection_id: str,
content: InputStoryContentUnion,
active_period: int,
caption: Optional[str] = None,
parse_mode: Optional[str] = None,
caption_entities: Optional[list[MessageEntity]] = None,
areas: Optional[list[StoryArea]] = None,
post_to_chat_page: Optional[bool] = None,
protect_content: Optional[bool] = None,
request_timeout: Optional[int] = None,
) -> Story:
"""
Posts a story on behalf of a managed business account. Requires the *can_manage_stories* business bot right. Returns :class:`aiogram.types.story.Story` on success.
Source: https://core.telegram.org/bots/api#poststory
:param business_connection_id: Unique identifier of the business connection
:param content: Content of the story
:param active_period: Period after which the story is moved to the archive, in seconds; must be one of :code:`6 * 3600`, :code:`12 * 3600`, :code:`86400`, or :code:`2 * 86400`
:param caption: Caption of the story, 0-2048 characters after entities parsing
:param parse_mode: Mode for parsing entities in the story caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
:param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*
:param areas: A JSON-serialized list of clickable areas to be shown on the story
:param post_to_chat_page: Pass :code:`True` to keep the story accessible after it expires
:param protect_content: Pass :code:`True` if the content of the story must be protected from forwarding and screenshotting
:param request_timeout: Request timeout
:return: Returns :class:`aiogram.types.story.Story` on success.
"""
call = PostStory(
business_connection_id=business_connection_id,
content=content,
active_period=active_period,
caption=caption,
parse_mode=parse_mode,
caption_entities=caption_entities,
areas=areas,
post_to_chat_page=post_to_chat_page,
protect_content=protect_content,
)
return await self(call, request_timeout=request_timeout)
async def read_business_message(
self,
business_connection_id: str,
chat_id: int,
message_id: int,
request_timeout: Optional[int] = None,
) -> bool:
"""
Marks incoming message as read on behalf of a business account. Requires the *can_read_messages* business bot right. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#readbusinessmessage
:param business_connection_id: Unique identifier of the business connection on behalf of which to read the message
:param chat_id: Unique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours.
:param message_id: Unique identifier of the message to mark as read
:param request_timeout: Request timeout
:return: Returns :code:`True` on success.
"""
call = ReadBusinessMessage(
business_connection_id=business_connection_id,
chat_id=chat_id,
message_id=message_id,
)
return await self(call, request_timeout=request_timeout)
async def remove_business_account_profile_photo(
self,
business_connection_id: str,
is_public: Optional[bool] = None,
request_timeout: Optional[int] = None,
) -> bool:
"""
Removes the current profile photo of a managed business account. Requires the *can_edit_profile_photo* business bot right. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#removebusinessaccountprofilephoto
:param business_connection_id: Unique identifier of the business connection
:param is_public: Pass True to remove the public photo, which is visible even if the main photo is hidden by the business account's privacy settings. After the main photo is removed, the previous profile photo (if present) becomes the main photo.
:param request_timeout: Request timeout
:return: Returns :code:`True` on success.
"""
call = RemoveBusinessAccountProfilePhoto(
business_connection_id=business_connection_id,
is_public=is_public,
)
return await self(call, request_timeout=request_timeout)
async def set_business_account_bio(
self,
business_connection_id: str,
bio: Optional[str] = None,
request_timeout: Optional[int] = None,
) -> bool:
"""
Changes the bio of a managed business account. Requires the *can_change_bio* business bot right. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#setbusinessaccountbio
:param business_connection_id: Unique identifier of the business connection
:param bio: The new value of the bio for the business account; 0-140 characters
:param request_timeout: Request timeout
:return: Returns :code:`True` on success.
"""
call = SetBusinessAccountBio(
business_connection_id=business_connection_id,
bio=bio,
)
return await self(call, request_timeout=request_timeout)
async def set_business_account_gift_settings(
self,
business_connection_id: str,
show_gift_button: bool,
accepted_gift_types: AcceptedGiftTypes,
request_timeout: Optional[int] = None,
) -> bool:
"""
Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the *can_change_gift_settings* business bot right. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#setbusinessaccountgiftsettings
:param business_connection_id: Unique identifier of the business connection
:param show_gift_button: Pass True, if a button for sending a gift to the user or by the business account must always be shown in the input field
:param accepted_gift_types: Types of gifts accepted by the business account
:param request_timeout: Request timeout
:return: Returns :code:`True` on success.
"""
call = SetBusinessAccountGiftSettings(
business_connection_id=business_connection_id,
show_gift_button=show_gift_button,
accepted_gift_types=accepted_gift_types,
)
return await self(call, request_timeout=request_timeout)
async def set_business_account_name(
self,
business_connection_id: str,
first_name: str,
last_name: Optional[str] = None,
request_timeout: Optional[int] = None,
) -> bool:
"""
Changes the first and last name of a managed business account. Requires the *can_change_name* business bot right. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#setbusinessaccountname
:param business_connection_id: Unique identifier of the business connection
:param first_name: The new value of the first name for the business account; 1-64 characters
:param last_name: The new value of the last name for the business account; 0-64 characters
:param request_timeout: Request timeout
:return: Returns :code:`True` on success.
"""
call = SetBusinessAccountName(
business_connection_id=business_connection_id,
first_name=first_name,
last_name=last_name,
)
return await self(call, request_timeout=request_timeout)
async def set_business_account_profile_photo(
self,
business_connection_id: str,
photo: InputProfilePhotoUnion,
is_public: Optional[bool] = None,
request_timeout: Optional[int] = None,
) -> bool:
"""
Changes the profile photo of a managed business account. Requires the *can_edit_profile_photo* business bot right. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#setbusinessaccountprofilephoto
:param business_connection_id: Unique identifier of the business connection
:param photo: The new profile photo to set
:param is_public: Pass True to set the public photo, which will be visible even if the main photo is hidden by the business account's privacy settings. An account can have only one public photo.
:param request_timeout: Request timeout
:return: Returns :code:`True` on success.
"""
call = SetBusinessAccountProfilePhoto(
business_connection_id=business_connection_id,
photo=photo,
is_public=is_public,
)
return await self(call, request_timeout=request_timeout)
async def set_business_account_username(
self,
business_connection_id: str,
username: Optional[str] = None,
request_timeout: Optional[int] = None,
) -> bool:
"""
Changes the username of a managed business account. Requires the *can_change_username* business bot right. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#setbusinessaccountusername
:param business_connection_id: Unique identifier of the business connection
:param username: The new value of the username for the business account; 0-32 characters
:param request_timeout: Request timeout
:return: Returns :code:`True` on success.
"""
call = SetBusinessAccountUsername(
business_connection_id=business_connection_id,
username=username,
)
return await self(call, request_timeout=request_timeout)
async def transfer_business_account_stars(
self,
business_connection_id: str,
star_count: int,
request_timeout: Optional[int] = None,
) -> bool:
"""
Transfers Telegram Stars from the business account balance to the bot's balance. Requires the *can_transfer_stars* business bot right. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#transferbusinessaccountstars
:param business_connection_id: Unique identifier of the business connection
:param star_count: Number of Telegram Stars to transfer; 1-10000
:param request_timeout: Request timeout
:return: Returns :code:`True` on success.
"""
call = TransferBusinessAccountStars(
business_connection_id=business_connection_id,
star_count=star_count,
)
return await self(call, request_timeout=request_timeout)
async def transfer_gift(
self,
business_connection_id: str,
owned_gift_id: str,
new_owner_chat_id: int,
star_count: Optional[int] = None,
request_timeout: Optional[int] = None,
) -> bool:
"""
Transfers an owned unique gift to another user. Requires the *can_transfer_and_upgrade_gifts* business bot right. Requires *can_transfer_stars* business bot right if the transfer is paid. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#transfergift
:param business_connection_id: Unique identifier of the business connection
:param owned_gift_id: Unique identifier of the regular gift that should be transferred
:param new_owner_chat_id: Unique identifier of the chat which will own the gift. The chat must be active in the last 24 hours.
:param star_count: The amount of Telegram Stars that will be paid for the transfer from the business account balance. If positive, then the *can_transfer_stars* business bot right is required.
:param request_timeout: Request timeout
:return: Returns :code:`True` on success.
"""
call = TransferGift(
business_connection_id=business_connection_id,
owned_gift_id=owned_gift_id,
new_owner_chat_id=new_owner_chat_id,
star_count=star_count,
)
return await self(call, request_timeout=request_timeout)
async def upgrade_gift(
self,
business_connection_id: str,
owned_gift_id: str,
keep_original_details: Optional[bool] = None,
star_count: Optional[int] = None,
request_timeout: Optional[int] = None,
) -> bool:
"""
Upgrades a given regular gift to a unique gift. Requires the *can_transfer_and_upgrade_gifts* business bot right. Additionally requires the *can_transfer_stars* business bot right if the upgrade is paid. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#upgradegift
:param business_connection_id: Unique identifier of the business connection
:param owned_gift_id: Unique identifier of the regular gift that should be upgraded to a unique one
:param keep_original_details: Pass True to keep the original gift text, sender and receiver in the upgraded gift
:param star_count: The amount of Telegram Stars that will be paid for the upgrade from the business account balance. If :code:`gift.prepaid_upgrade_star_count > 0`, then pass 0, otherwise, the *can_transfer_stars* business bot right is required and :code:`gift.upgrade_star_count` must be passed.
:param request_timeout: Request timeout
:return: Returns :code:`True` on success.
"""
call = UpgradeGift(
business_connection_id=business_connection_id,
owned_gift_id=owned_gift_id,
keep_original_details=keep_original_details,
star_count=star_count,
)
return await self(call, request_timeout=request_timeout)

View file

@ -10,11 +10,14 @@ from .encrypted_passport_element import EncryptedPassportElement
from .inline_query_result_type import InlineQueryResultType from .inline_query_result_type import InlineQueryResultType
from .input_media_type import InputMediaType from .input_media_type import InputMediaType
from .input_paid_media_type import InputPaidMediaType from .input_paid_media_type import InputPaidMediaType
from .input_profile_photo_type import InputProfilePhotoType
from .input_story_content_type import InputStoryContentType
from .keyboard_button_poll_type_type import KeyboardButtonPollTypeType from .keyboard_button_poll_type_type import KeyboardButtonPollTypeType
from .mask_position_point import MaskPositionPoint from .mask_position_point import MaskPositionPoint
from .menu_button_type import MenuButtonType from .menu_button_type import MenuButtonType
from .message_entity_type import MessageEntityType from .message_entity_type import MessageEntityType
from .message_origin_type import MessageOriginType from .message_origin_type import MessageOriginType
from .owned_gift_type import OwnedGiftType
from .paid_media_type import PaidMediaType from .paid_media_type import PaidMediaType
from .parse_mode import ParseMode from .parse_mode import ParseMode
from .passport_element_error_type import PassportElementErrorType from .passport_element_error_type import PassportElementErrorType
@ -23,8 +26,12 @@ from .reaction_type_type import ReactionTypeType
from .revenue_withdrawal_state_type import RevenueWithdrawalStateType from .revenue_withdrawal_state_type import RevenueWithdrawalStateType
from .sticker_format import StickerFormat from .sticker_format import StickerFormat
from .sticker_type import StickerType from .sticker_type import StickerType
from .story_area_type_type import StoryAreaTypeType
from .topic_icon_color import TopicIconColor from .topic_icon_color import TopicIconColor
from .transaction_partner_type import TransactionPartnerType from .transaction_partner_type import TransactionPartnerType
from .transaction_partner_user_transaction_type_enum import (
TransactionPartnerUserTransactionTypeEnum,
)
from .update_type import UpdateType from .update_type import UpdateType
__all__ = ( __all__ = (
@ -40,11 +47,14 @@ __all__ = (
"InlineQueryResultType", "InlineQueryResultType",
"InputMediaType", "InputMediaType",
"InputPaidMediaType", "InputPaidMediaType",
"InputProfilePhotoType",
"InputStoryContentType",
"KeyboardButtonPollTypeType", "KeyboardButtonPollTypeType",
"MaskPositionPoint", "MaskPositionPoint",
"MenuButtonType", "MenuButtonType",
"MessageEntityType", "MessageEntityType",
"MessageOriginType", "MessageOriginType",
"OwnedGiftType",
"PaidMediaType", "PaidMediaType",
"ParseMode", "ParseMode",
"PassportElementErrorType", "PassportElementErrorType",
@ -53,7 +63,9 @@ __all__ = (
"RevenueWithdrawalStateType", "RevenueWithdrawalStateType",
"StickerFormat", "StickerFormat",
"StickerType", "StickerType",
"StoryAreaTypeType",
"TopicIconColor", "TopicIconColor",
"TransactionPartnerType", "TransactionPartnerType",
"TransactionPartnerUserTransactionTypeEnum",
"UpdateType", "UpdateType",
) )

View file

@ -42,6 +42,8 @@ class ContentType(str, Enum):
REFUNDED_PAYMENT = "refunded_payment" REFUNDED_PAYMENT = "refunded_payment"
USERS_SHARED = "users_shared" USERS_SHARED = "users_shared"
CHAT_SHARED = "chat_shared" CHAT_SHARED = "chat_shared"
GIFT = "gift"
UNIQUE_GIFT = "unique_gift"
CONNECTED_WEBSITE = "connected_website" CONNECTED_WEBSITE = "connected_website"
WRITE_ACCESS_ALLOWED = "write_access_allowed" WRITE_ACCESS_ALLOWED = "write_access_allowed"
PASSPORT_DATA = "passport_data" PASSPORT_DATA = "passport_data"
@ -58,6 +60,7 @@ class ContentType(str, Enum):
GIVEAWAY = "giveaway" GIVEAWAY = "giveaway"
GIVEAWAY_WINNERS = "giveaway_winners" GIVEAWAY_WINNERS = "giveaway_winners"
GIVEAWAY_COMPLETED = "giveaway_completed" GIVEAWAY_COMPLETED = "giveaway_completed"
PAID_MESSAGE_PRICE_CHANGED = "paid_message_price_changed"
VIDEO_CHAT_SCHEDULED = "video_chat_scheduled" VIDEO_CHAT_SCHEDULED = "video_chat_scheduled"
VIDEO_CHAT_STARTED = "video_chat_started" VIDEO_CHAT_STARTED = "video_chat_started"
VIDEO_CHAT_ENDED = "video_chat_ended" VIDEO_CHAT_ENDED = "video_chat_ended"

View file

@ -0,0 +1,12 @@
from enum import Enum
class InputProfilePhotoType(str, Enum):
"""
This object represents input profile photo type
Source: https://core.telegram.org/bots/api#inputprofilephoto
"""
STATIC = "static"
ANIMATED = "animated"

View file

@ -0,0 +1,12 @@
from enum import Enum
class InputStoryContentType(str, Enum):
"""
This object represents input story content photo type.
Source: https://core.telegram.org/bots/api#inputstorycontentphoto
"""
PHOTO = "photo"
VIDEO = "video"

View file

@ -0,0 +1,12 @@
from enum import Enum
class OwnedGiftType(str, Enum):
"""
This object represents owned gift type
Source: https://core.telegram.org/bots/api#ownedgift
"""
REGULAR = "regular"
UNIQUE = "unique"

View file

@ -0,0 +1,15 @@
from enum import Enum
class StoryAreaTypeType(str, Enum):
"""
This object represents input profile photo type
Source: https://core.telegram.org/bots/api#storyareatype
"""
LOCATION = "location"
SUGGESTED_REACTION = "suggested_reaction"
LINK = "link"
WEATHER = "weather"
UNIQUE_GIFT = "unique_gift"

View file

@ -0,0 +1,15 @@
from enum import Enum
class TransactionPartnerUserTransactionTypeEnum(str, Enum):
"""
This object represents type of the transaction that were made by partner user.
Source: https://core.telegram.org/bots/api#transactionpartneruser
"""
INVOICE_PAYMENT = "invoice_payment"
PAID_MEDIA_PAYMENT = "paid_media_payment"
GIFT_PURCHASE = "gift_purchase"
PREMIUM_PURCHASE = "premium_purchase"
BUSINESS_ACCOUNT_TRANSFER = "business_account_transfer"

View file

@ -11,6 +11,7 @@ from .base import Request, Response, TelegramMethod
from .close import Close from .close import Close
from .close_forum_topic import CloseForumTopic from .close_forum_topic import CloseForumTopic
from .close_general_forum_topic import CloseGeneralForumTopic from .close_general_forum_topic import CloseGeneralForumTopic
from .convert_gift_to_stars import ConvertGiftToStars
from .copy_message import CopyMessage from .copy_message import CopyMessage
from .copy_messages import CopyMessages from .copy_messages import CopyMessages
from .create_chat_invite_link import CreateChatInviteLink from .create_chat_invite_link import CreateChatInviteLink
@ -19,6 +20,7 @@ from .create_forum_topic import CreateForumTopic
from .create_invoice_link import CreateInvoiceLink from .create_invoice_link import CreateInvoiceLink
from .create_new_sticker_set import CreateNewStickerSet from .create_new_sticker_set import CreateNewStickerSet
from .decline_chat_join_request import DeclineChatJoinRequest from .decline_chat_join_request import DeclineChatJoinRequest
from .delete_business_messages import DeleteBusinessMessages
from .delete_chat_photo import DeleteChatPhoto from .delete_chat_photo import DeleteChatPhoto
from .delete_chat_sticker_set import DeleteChatStickerSet from .delete_chat_sticker_set import DeleteChatStickerSet
from .delete_forum_topic import DeleteForumTopic from .delete_forum_topic import DeleteForumTopic
@ -27,6 +29,7 @@ from .delete_messages import DeleteMessages
from .delete_my_commands import DeleteMyCommands from .delete_my_commands import DeleteMyCommands
from .delete_sticker_from_set import DeleteStickerFromSet from .delete_sticker_from_set import DeleteStickerFromSet
from .delete_sticker_set import DeleteStickerSet from .delete_sticker_set import DeleteStickerSet
from .delete_story import DeleteStory
from .delete_webhook import DeleteWebhook from .delete_webhook import DeleteWebhook
from .edit_chat_invite_link import EditChatInviteLink from .edit_chat_invite_link import EditChatInviteLink
from .edit_chat_subscription_invite_link import EditChatSubscriptionInviteLink from .edit_chat_subscription_invite_link import EditChatSubscriptionInviteLink
@ -37,11 +40,14 @@ from .edit_message_live_location import EditMessageLiveLocation
from .edit_message_media import EditMessageMedia from .edit_message_media import EditMessageMedia
from .edit_message_reply_markup import EditMessageReplyMarkup from .edit_message_reply_markup import EditMessageReplyMarkup
from .edit_message_text import EditMessageText from .edit_message_text import EditMessageText
from .edit_story import EditStory
from .edit_user_star_subscription import EditUserStarSubscription from .edit_user_star_subscription import EditUserStarSubscription
from .export_chat_invite_link import ExportChatInviteLink from .export_chat_invite_link import ExportChatInviteLink
from .forward_message import ForwardMessage from .forward_message import ForwardMessage
from .forward_messages import ForwardMessages from .forward_messages import ForwardMessages
from .get_available_gifts import GetAvailableGifts from .get_available_gifts import GetAvailableGifts
from .get_business_account_gifts import GetBusinessAccountGifts
from .get_business_account_star_balance import GetBusinessAccountStarBalance
from .get_business_connection import GetBusinessConnection from .get_business_connection import GetBusinessConnection
from .get_chat import GetChat from .get_chat import GetChat
from .get_chat_administrators import GetChatAdministrators from .get_chat_administrators import GetChatAdministrators
@ -64,12 +70,16 @@ from .get_updates import GetUpdates
from .get_user_chat_boosts import GetUserChatBoosts from .get_user_chat_boosts import GetUserChatBoosts
from .get_user_profile_photos import GetUserProfilePhotos from .get_user_profile_photos import GetUserProfilePhotos
from .get_webhook_info import GetWebhookInfo from .get_webhook_info import GetWebhookInfo
from .gift_premium_subscription import GiftPremiumSubscription
from .hide_general_forum_topic import HideGeneralForumTopic from .hide_general_forum_topic import HideGeneralForumTopic
from .leave_chat import LeaveChat from .leave_chat import LeaveChat
from .log_out import LogOut from .log_out import LogOut
from .pin_chat_message import PinChatMessage from .pin_chat_message import PinChatMessage
from .post_story import PostStory
from .promote_chat_member import PromoteChatMember from .promote_chat_member import PromoteChatMember
from .read_business_message import ReadBusinessMessage
from .refund_star_payment import RefundStarPayment from .refund_star_payment import RefundStarPayment
from .remove_business_account_profile_photo import RemoveBusinessAccountProfilePhoto
from .remove_chat_verification import RemoveChatVerification from .remove_chat_verification import RemoveChatVerification
from .remove_user_verification import RemoveUserVerification from .remove_user_verification import RemoveUserVerification
from .reopen_forum_topic import ReopenForumTopic from .reopen_forum_topic import ReopenForumTopic
@ -98,6 +108,11 @@ from .send_venue import SendVenue
from .send_video import SendVideo from .send_video import SendVideo
from .send_video_note import SendVideoNote from .send_video_note import SendVideoNote
from .send_voice import SendVoice from .send_voice import SendVoice
from .set_business_account_bio import SetBusinessAccountBio
from .set_business_account_gift_settings import SetBusinessAccountGiftSettings
from .set_business_account_name import SetBusinessAccountName
from .set_business_account_profile_photo import SetBusinessAccountProfilePhoto
from .set_business_account_username import SetBusinessAccountUsername
from .set_chat_administrator_custom_title import SetChatAdministratorCustomTitle from .set_chat_administrator_custom_title import SetChatAdministratorCustomTitle
from .set_chat_description import SetChatDescription from .set_chat_description import SetChatDescription
from .set_chat_menu_button import SetChatMenuButton from .set_chat_menu_button import SetChatMenuButton
@ -124,6 +139,8 @@ from .set_user_emoji_status import SetUserEmojiStatus
from .set_webhook import SetWebhook from .set_webhook import SetWebhook
from .stop_message_live_location import StopMessageLiveLocation from .stop_message_live_location import StopMessageLiveLocation
from .stop_poll import StopPoll from .stop_poll import StopPoll
from .transfer_business_account_stars import TransferBusinessAccountStars
from .transfer_gift import TransferGift
from .unban_chat_member import UnbanChatMember from .unban_chat_member import UnbanChatMember
from .unban_chat_sender_chat import UnbanChatSenderChat from .unban_chat_sender_chat import UnbanChatSenderChat
from .unhide_general_forum_topic import UnhideGeneralForumTopic from .unhide_general_forum_topic import UnhideGeneralForumTopic
@ -131,6 +148,7 @@ from .unpin_all_chat_messages import UnpinAllChatMessages
from .unpin_all_forum_topic_messages import UnpinAllForumTopicMessages from .unpin_all_forum_topic_messages import UnpinAllForumTopicMessages
from .unpin_all_general_forum_topic_messages import UnpinAllGeneralForumTopicMessages from .unpin_all_general_forum_topic_messages import UnpinAllGeneralForumTopicMessages
from .unpin_chat_message import UnpinChatMessage from .unpin_chat_message import UnpinChatMessage
from .upgrade_gift import UpgradeGift
from .upload_sticker_file import UploadStickerFile from .upload_sticker_file import UploadStickerFile
from .verify_chat import VerifyChat from .verify_chat import VerifyChat
from .verify_user import VerifyUser from .verify_user import VerifyUser
@ -148,6 +166,7 @@ __all__ = (
"Close", "Close",
"CloseForumTopic", "CloseForumTopic",
"CloseGeneralForumTopic", "CloseGeneralForumTopic",
"ConvertGiftToStars",
"CopyMessage", "CopyMessage",
"CopyMessages", "CopyMessages",
"CreateChatInviteLink", "CreateChatInviteLink",
@ -156,6 +175,7 @@ __all__ = (
"CreateInvoiceLink", "CreateInvoiceLink",
"CreateNewStickerSet", "CreateNewStickerSet",
"DeclineChatJoinRequest", "DeclineChatJoinRequest",
"DeleteBusinessMessages",
"DeleteChatPhoto", "DeleteChatPhoto",
"DeleteChatStickerSet", "DeleteChatStickerSet",
"DeleteForumTopic", "DeleteForumTopic",
@ -164,6 +184,7 @@ __all__ = (
"DeleteMyCommands", "DeleteMyCommands",
"DeleteStickerFromSet", "DeleteStickerFromSet",
"DeleteStickerSet", "DeleteStickerSet",
"DeleteStory",
"DeleteWebhook", "DeleteWebhook",
"EditChatInviteLink", "EditChatInviteLink",
"EditChatSubscriptionInviteLink", "EditChatSubscriptionInviteLink",
@ -174,11 +195,14 @@ __all__ = (
"EditMessageMedia", "EditMessageMedia",
"EditMessageReplyMarkup", "EditMessageReplyMarkup",
"EditMessageText", "EditMessageText",
"EditStory",
"EditUserStarSubscription", "EditUserStarSubscription",
"ExportChatInviteLink", "ExportChatInviteLink",
"ForwardMessage", "ForwardMessage",
"ForwardMessages", "ForwardMessages",
"GetAvailableGifts", "GetAvailableGifts",
"GetBusinessAccountGifts",
"GetBusinessAccountStarBalance",
"GetBusinessConnection", "GetBusinessConnection",
"GetChat", "GetChat",
"GetChatAdministrators", "GetChatAdministrators",
@ -201,12 +225,16 @@ __all__ = (
"GetUserChatBoosts", "GetUserChatBoosts",
"GetUserProfilePhotos", "GetUserProfilePhotos",
"GetWebhookInfo", "GetWebhookInfo",
"GiftPremiumSubscription",
"HideGeneralForumTopic", "HideGeneralForumTopic",
"LeaveChat", "LeaveChat",
"LogOut", "LogOut",
"PinChatMessage", "PinChatMessage",
"PostStory",
"PromoteChatMember", "PromoteChatMember",
"ReadBusinessMessage",
"RefundStarPayment", "RefundStarPayment",
"RemoveBusinessAccountProfilePhoto",
"RemoveChatVerification", "RemoveChatVerification",
"RemoveUserVerification", "RemoveUserVerification",
"ReopenForumTopic", "ReopenForumTopic",
@ -237,6 +265,11 @@ __all__ = (
"SendVideo", "SendVideo",
"SendVideoNote", "SendVideoNote",
"SendVoice", "SendVoice",
"SetBusinessAccountBio",
"SetBusinessAccountGiftSettings",
"SetBusinessAccountName",
"SetBusinessAccountProfilePhoto",
"SetBusinessAccountUsername",
"SetChatAdministratorCustomTitle", "SetChatAdministratorCustomTitle",
"SetChatDescription", "SetChatDescription",
"SetChatMenuButton", "SetChatMenuButton",
@ -264,6 +297,8 @@ __all__ = (
"StopMessageLiveLocation", "StopMessageLiveLocation",
"StopPoll", "StopPoll",
"TelegramMethod", "TelegramMethod",
"TransferBusinessAccountStars",
"TransferGift",
"UnbanChatMember", "UnbanChatMember",
"UnbanChatSenderChat", "UnbanChatSenderChat",
"UnhideGeneralForumTopic", "UnhideGeneralForumTopic",
@ -271,6 +306,7 @@ __all__ = (
"UnpinAllForumTopicMessages", "UnpinAllForumTopicMessages",
"UnpinAllGeneralForumTopicMessages", "UnpinAllGeneralForumTopicMessages",
"UnpinChatMessage", "UnpinChatMessage",
"UpgradeGift",
"UploadStickerFile", "UploadStickerFile",
"VerifyChat", "VerifyChat",
"VerifyUser", "VerifyUser",

View file

@ -0,0 +1,42 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any
from .base import TelegramMethod
class ConvertGiftToStars(TelegramMethod[bool]):
"""
Converts a given regular gift to Telegram Stars. Requires the *can_convert_gifts_to_stars* business bot right. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#convertgifttostars
"""
__returning__ = bool
__api_method__ = "convertGiftToStars"
business_connection_id: str
"""Unique identifier of the business connection"""
owned_gift_id: str
"""Unique identifier of the regular gift that should be converted to Telegram Stars"""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
# This section was auto-generated via `butcher`
def __init__(
__pydantic__self__,
*,
business_connection_id: str,
owned_gift_id: str,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
# Is needed only for type checking and IDE support without any additional plugins
super().__init__(
business_connection_id=business_connection_id,
owned_gift_id=owned_gift_id,
**__pydantic_kwargs,
)

View file

@ -21,7 +21,7 @@ class CreateChatSubscriptionInviteLink(TelegramMethod[ChatInviteLink]):
subscription_period: DateTimeUnion subscription_period: DateTimeUnion
"""The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days).""" """The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days)."""
subscription_price: int subscription_price: int
"""The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500""" """The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-10000"""
name: Optional[str] = None name: Optional[str] = None
"""Invite link name; 0-32 characters""" """Invite link name; 0-32 characters"""

View file

@ -31,7 +31,7 @@ class CreateInvoiceLink(TelegramMethod[str]):
provider_token: Optional[str] = None provider_token: Optional[str] = None
"""Payment provider token, obtained via `@BotFather <https://t.me/botfather>`_. Pass an empty string for payments in `Telegram Stars <https://t.me/BotNews/90>`_.""" """Payment provider token, obtained via `@BotFather <https://t.me/botfather>`_. Pass an empty string for payments in `Telegram Stars <https://t.me/BotNews/90>`_."""
subscription_period: Optional[int] = None subscription_period: Optional[int] = None
"""The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 2500 Telegram Stars.""" """The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 10000 Telegram Stars."""
max_tip_amount: Optional[int] = None max_tip_amount: Optional[int] = None
"""The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json <https://core.telegram.org/bots/payments/currencies.json>`_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars <https://t.me/BotNews/90>`_.""" """The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json <https://core.telegram.org/bots/payments/currencies.json>`_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars <https://t.me/BotNews/90>`_."""
suggested_tip_amounts: Optional[list[int]] = None suggested_tip_amounts: Optional[list[int]] = None

View file

@ -0,0 +1,42 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any
from .base import TelegramMethod
class DeleteBusinessMessages(TelegramMethod[bool]):
"""
Delete messages on behalf of a business account. Requires the *can_delete_outgoing_messages* business bot right to delete messages sent by the bot itself, or the *can_delete_all_messages* business bot right to delete any message. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#deletebusinessmessages
"""
__returning__ = bool
__api_method__ = "deleteBusinessMessages"
business_connection_id: str
"""Unique identifier of the business connection on behalf of which to delete the messages"""
message_ids: list[int]
"""A JSON-serialized list of 1-100 identifiers of messages to delete. All messages must be from the same chat. See :class:`aiogram.methods.delete_message.DeleteMessage` for limitations on which messages can be deleted"""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
# This section was auto-generated via `butcher`
def __init__(
__pydantic__self__,
*,
business_connection_id: str,
message_ids: list[int],
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
# Is needed only for type checking and IDE support without any additional plugins
super().__init__(
business_connection_id=business_connection_id,
message_ids=message_ids,
**__pydantic_kwargs,
)

View file

@ -0,0 +1,42 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any
from .base import TelegramMethod
class DeleteStory(TelegramMethod[bool]):
"""
Deletes a story previously posted by the bot on behalf of a managed business account. Requires the *can_manage_stories* business bot right. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#deletestory
"""
__returning__ = bool
__api_method__ = "deleteStory"
business_connection_id: str
"""Unique identifier of the business connection"""
story_id: int
"""Unique identifier of the story to delete"""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
# This section was auto-generated via `butcher`
def __init__(
__pydantic__self__,
*,
business_connection_id: str,
story_id: int,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
# Is needed only for type checking and IDE support without any additional plugins
super().__init__(
business_connection_id=business_connection_id,
story_id=story_id,
**__pydantic_kwargs,
)

View file

@ -0,0 +1,63 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional
from ..types import InputStoryContentUnion, MessageEntity, Story, StoryArea
from .base import TelegramMethod
class EditStory(TelegramMethod[Story]):
"""
Edits a story previously posted by the bot on behalf of a managed business account. Requires the *can_manage_stories* business bot right. Returns :class:`aiogram.types.story.Story` on success.
Source: https://core.telegram.org/bots/api#editstory
"""
__returning__ = Story
__api_method__ = "editStory"
business_connection_id: str
"""Unique identifier of the business connection"""
story_id: int
"""Unique identifier of the story to edit"""
content: InputStoryContentUnion
"""Content of the story"""
caption: Optional[str] = None
"""Caption of the story, 0-2048 characters after entities parsing"""
parse_mode: Optional[str] = None
"""Mode for parsing entities in the story caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
caption_entities: Optional[list[MessageEntity]] = None
"""A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
areas: Optional[list[StoryArea]] = None
"""A JSON-serialized list of clickable areas to be shown on the story"""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
# This section was auto-generated via `butcher`
def __init__(
__pydantic__self__,
*,
business_connection_id: str,
story_id: int,
content: InputStoryContentUnion,
caption: Optional[str] = None,
parse_mode: Optional[str] = None,
caption_entities: Optional[list[MessageEntity]] = None,
areas: Optional[list[StoryArea]] = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
# Is needed only for type checking and IDE support without any additional plugins
super().__init__(
business_connection_id=business_connection_id,
story_id=story_id,
content=content,
caption=caption,
parse_mode=parse_mode,
caption_entities=caption_entities,
areas=areas,
**__pydantic_kwargs,
)

View file

@ -0,0 +1,71 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional
from ..types import OwnedGifts
from .base import TelegramMethod
class GetBusinessAccountGifts(TelegramMethod[OwnedGifts]):
"""
Returns the gifts received and owned by a managed business account. Requires the *can_view_gifts_and_stars* business bot right. Returns :class:`aiogram.types.owned_gifts.OwnedGifts` on success.
Source: https://core.telegram.org/bots/api#getbusinessaccountgifts
"""
__returning__ = OwnedGifts
__api_method__ = "getBusinessAccountGifts"
business_connection_id: str
"""Unique identifier of the business connection"""
exclude_unsaved: Optional[bool] = None
"""Pass True to exclude gifts that aren't saved to the account's profile page"""
exclude_saved: Optional[bool] = None
"""Pass True to exclude gifts that are saved to the account's profile page"""
exclude_unlimited: Optional[bool] = None
"""Pass True to exclude gifts that can be purchased an unlimited number of times"""
exclude_limited: Optional[bool] = None
"""Pass True to exclude gifts that can be purchased a limited number of times"""
exclude_unique: Optional[bool] = None
"""Pass True to exclude unique gifts"""
sort_by_price: Optional[bool] = None
"""Pass True to sort results by gift price instead of send date. Sorting is applied before pagination."""
offset: Optional[str] = None
"""Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results"""
limit: Optional[int] = None
"""The maximum number of gifts to be returned; 1-100. Defaults to 100"""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
# This section was auto-generated via `butcher`
def __init__(
__pydantic__self__,
*,
business_connection_id: str,
exclude_unsaved: Optional[bool] = None,
exclude_saved: Optional[bool] = None,
exclude_unlimited: Optional[bool] = None,
exclude_limited: Optional[bool] = None,
exclude_unique: Optional[bool] = None,
sort_by_price: Optional[bool] = None,
offset: Optional[str] = None,
limit: Optional[int] = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
# Is needed only for type checking and IDE support without any additional plugins
super().__init__(
business_connection_id=business_connection_id,
exclude_unsaved=exclude_unsaved,
exclude_saved=exclude_saved,
exclude_unlimited=exclude_unlimited,
exclude_limited=exclude_limited,
exclude_unique=exclude_unique,
sort_by_price=sort_by_price,
offset=offset,
limit=limit,
**__pydantic_kwargs,
)

View file

@ -0,0 +1,33 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any
from ..types import StarAmount
from .base import TelegramMethod
class GetBusinessAccountStarBalance(TelegramMethod[StarAmount]):
"""
Returns the amount of Telegram Stars owned by a managed business account. Requires the *can_view_gifts_and_stars* business bot right. Returns :class:`aiogram.types.star_amount.StarAmount` on success.
Source: https://core.telegram.org/bots/api#getbusinessaccountstarbalance
"""
__returning__ = StarAmount
__api_method__ = "getBusinessAccountStarBalance"
business_connection_id: str
"""Unique identifier of the business connection"""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
# This section was auto-generated via `butcher`
def __init__(
__pydantic__self__, *, business_connection_id: str, **__pydantic_kwargs: Any
) -> None:
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
# Is needed only for type checking and IDE support without any additional plugins
super().__init__(business_connection_id=business_connection_id, **__pydantic_kwargs)

View file

@ -0,0 +1,59 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional
from ..types import MessageEntity
from .base import TelegramMethod
class GiftPremiumSubscription(TelegramMethod[bool]):
"""
Gifts a Telegram Premium subscription to the given user. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#giftpremiumsubscription
"""
__returning__ = bool
__api_method__ = "giftPremiumSubscription"
user_id: int
"""Unique identifier of the target user who will receive a Telegram Premium subscription"""
month_count: int
"""Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12"""
star_count: int
"""Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months"""
text: Optional[str] = None
"""Text that will be shown along with the service message about the subscription; 0-128 characters"""
text_parse_mode: Optional[str] = None
"""Mode for parsing entities in the text. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored."""
text_entities: Optional[list[MessageEntity]] = None
"""A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of *text_parse_mode*. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored."""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
# This section was auto-generated via `butcher`
def __init__(
__pydantic__self__,
*,
user_id: int,
month_count: int,
star_count: int,
text: Optional[str] = None,
text_parse_mode: Optional[str] = None,
text_entities: Optional[list[MessageEntity]] = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
# Is needed only for type checking and IDE support without any additional plugins
super().__init__(
user_id=user_id,
month_count=month_count,
star_count=star_count,
text=text,
text_parse_mode=text_parse_mode,
text_entities=text_entities,
**__pydantic_kwargs,
)

Some files were not shown because too many files have changed in this diff Show more