Merge branch 'dev-3.x'

This commit is contained in:
JRoot Junior 2026-01-02 02:55:22 +02:00
commit b01b2ed8fc
No known key found for this signature in database
GPG key ID: 738964250D5FF6E2
409 changed files with 12336 additions and 6862 deletions

View file

@ -1 +1 @@
9.2
9.3

View file

@ -22,9 +22,9 @@
{
"type": "Integer",
"required": false,
"description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
"html_description": "<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
"description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
"html_description": "<td>Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
@ -115,6 +115,14 @@
"rst_description": "Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits <https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance\n",
"name": "allow_paid_broadcast"
},
{
"type": "String",
"required": false,
"description": "Unique identifier of the message effect to be added to the message; only available when copying to private chats",
"html_description": "<td>Unique identifier of the message effect to be added to the message; only available when copying to private chats</td>",
"rst_description": "Unique identifier of the message effect to be added to the message; only available when copying to private chats\n",
"name": "message_effect_id"
},
{
"type": "SuggestedPostParameters",
"required": false,

View file

@ -22,9 +22,9 @@
{
"type": "Integer",
"required": false,
"description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
"html_description": "<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
"description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
"html_description": "<td>Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{

View file

@ -7,9 +7,9 @@
"object": {
"anchor": "deleteforumtopic",
"name": "deleteForumTopic",
"description": "Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success.",
"html_description": "<p>Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the <em>can_delete_messages</em> administrator rights. Returns <em>True</em> on success.</p>",
"rst_description": "Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_delete_messages* administrator rights. Returns :code:`True` on success.",
"description": "Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success.",
"html_description": "<p>Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the <em>can_delete_messages</em> administrator rights. Returns <em>True</em> on success.</p>",
"rst_description": "Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the *can_delete_messages* administrator rights. Returns :code:`True` on success.",
"annotations": [
{
"type": "Integer or String",

View file

@ -7,9 +7,9 @@
"object": {
"anchor": "editforumtopic",
"name": "editForumTopic",
"description": "Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.",
"html_description": "<p>Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the <em>can_manage_topics</em> administrator rights, unless it is the creator of the topic. Returns <em>True</em> on success.</p>",
"rst_description": "Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights, unless it is the creator of the topic. Returns :code:`True` on success.",
"description": "Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.",
"html_description": "<p>Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the <em>can_manage_topics</em> administrator rights, unless it is the creator of the topic. Returns <em>True</em> on success.</p>",
"rst_description": "Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights, unless it is the creator of the topic. Returns :code:`True` on success.",
"annotations": [
{
"type": "Integer or String",

View file

@ -22,9 +22,9 @@
{
"type": "Integer",
"required": false,
"description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
"html_description": "<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
"description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
"html_description": "<td>Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
@ -67,6 +67,14 @@
"rst_description": "Protects the contents of the forwarded message from forwarding and saving\n",
"name": "protect_content"
},
{
"type": "String",
"required": false,
"description": "Unique identifier of the message effect to be added to the message; only available when forwarding to private chats",
"html_description": "<td>Unique identifier of the message effect to be added to the message; only available when forwarding to private chats</td>",
"rst_description": "Unique identifier of the message effect to be added to the message; only available when forwarding to private chats\n",
"name": "message_effect_id"
},
{
"type": "SuggestedPostParameters",
"required": false,

View file

@ -22,9 +22,9 @@
{
"type": "Integer",
"required": false,
"description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
"html_description": "<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
"description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
"html_description": "<td>Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{

View file

@ -46,10 +46,18 @@
{
"type": "Boolean",
"required": false,
"description": "Pass True to exclude gifts that can be purchased a limited number of times",
"html_description": "<td>Pass <em>True</em> to exclude gifts that can be purchased a limited number of times</td>",
"rst_description": "Pass :code:`True` to exclude gifts that can be purchased a limited number of times\n",
"name": "exclude_limited"
"description": "Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique",
"html_description": "<td>Pass <em>True</em> to exclude gifts that can be purchased a limited number of times and can be upgraded to unique</td>",
"rst_description": "Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can be upgraded to unique\n",
"name": "exclude_limited_upgradable"
},
{
"type": "Boolean",
"required": false,
"description": "Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique",
"html_description": "<td>Pass <em>True</em> to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique</td>",
"rst_description": "Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique\n",
"name": "exclude_limited_non_upgradable"
},
{
"type": "Boolean",
@ -59,6 +67,14 @@
"rst_description": "Pass :code:`True` to exclude unique gifts\n",
"name": "exclude_unique"
},
{
"type": "Boolean",
"required": false,
"description": "Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram",
"html_description": "<td>Pass <em>True</em> to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram</td>",
"rst_description": "Pass :code:`True` to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram\n",
"name": "exclude_from_blockchain"
},
{
"type": "Boolean",
"required": false,
@ -82,6 +98,18 @@
"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"
},
{
"type": "Boolean",
"required": false,
"description": "Pass True to exclude gifts that can be purchased a limited number of times",
"html_description": "<td>Pass <em>True</em> to exclude gifts that can be purchased a limited number of times</td>",
"rst_description": "Pass :code:`True` to exclude gifts that can be purchased a limited number of times\n",
"name": "exclude_limited",
"deprecated": {
"version": "9.3",
"release_date": "2025-12-31"
}
}
],
"category": "methods"

105
.butcher/methods/getChatGifts/entity.json generated Normal file
View file

@ -0,0 +1,105 @@
{
"meta": {},
"group": {
"title": "Available methods",
"anchor": "available-methods"
},
"object": {
"anchor": "getchatgifts",
"name": "getChatGifts",
"description": "Returns the gifts owned by a chat. Returns OwnedGifts on success.",
"html_description": "<p>Returns the gifts owned by a chat. Returns <a href=\"#ownedgifts\">OwnedGifts</a> on success.</p>",
"rst_description": "Returns the gifts owned by a chat. Returns :class:`aiogram.types.owned_gifts.OwnedGifts` on success.",
"annotations": [
{
"type": "Integer or String",
"required": true,
"description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)",
"html_description": "<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>",
"rst_description": "Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)\n",
"name": "chat_id"
},
{
"type": "Boolean",
"required": false,
"description": "Pass True to exclude gifts that aren't saved to the chat's profile page. Always True, unless the bot has the can_post_messages administrator right in the channel.",
"html_description": "<td>Pass <em>True</em> to exclude gifts that aren't saved to the chat's profile page. Always <em>True</em>, unless the bot has the <em>can_post_messages</em> administrator right in the channel.</td>",
"rst_description": "Pass :code:`True` to exclude gifts that aren't saved to the chat's profile page. Always :code:`True`, unless the bot has the *can_post_messages* administrator right in the channel.\n",
"name": "exclude_unsaved"
},
{
"type": "Boolean",
"required": false,
"description": "Pass True to exclude gifts that are saved to the chat's profile page. Always False, unless the bot has the can_post_messages administrator right in the channel.",
"html_description": "<td>Pass <em>True</em> to exclude gifts that are saved to the chat's profile page. Always <em>False</em>, unless the bot has the <em>can_post_messages</em> administrator right in the channel.</td>",
"rst_description": "Pass :code:`True` to exclude gifts that are saved to the chat's profile page. Always :code:`False`, unless the bot has the *can_post_messages* administrator right in the channel.\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 <em>True</em> to exclude gifts that can be purchased an unlimited number of times</td>",
"rst_description": "Pass :code:`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 and can be upgraded to unique",
"html_description": "<td>Pass <em>True</em> to exclude gifts that can be purchased a limited number of times and can be upgraded to unique</td>",
"rst_description": "Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can be upgraded to unique\n",
"name": "exclude_limited_upgradable"
},
{
"type": "Boolean",
"required": false,
"description": "Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique",
"html_description": "<td>Pass <em>True</em> to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique</td>",
"rst_description": "Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique\n",
"name": "exclude_limited_non_upgradable"
},
{
"type": "Boolean",
"required": false,
"description": "Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram",
"html_description": "<td>Pass <em>True</em> to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram</td>",
"rst_description": "Pass :code:`True` to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram\n",
"name": "exclude_from_blockchain"
},
{
"type": "Boolean",
"required": false,
"description": "Pass True to exclude unique gifts",
"html_description": "<td>Pass <em>True</em> to exclude unique gifts</td>",
"rst_description": "Pass :code:`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 <em>True</em> to sort results by gift price instead of send date. Sorting is applied before pagination.</td>",
"rst_description": "Pass :code:`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 an 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 an 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 an 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,89 @@
{
"meta": {},
"group": {
"title": "Available methods",
"anchor": "available-methods"
},
"object": {
"anchor": "getusergifts",
"name": "getUserGifts",
"description": "Returns the gifts owned and hosted by a user. Returns OwnedGifts on success.",
"html_description": "<p>Returns the gifts owned and hosted by a user. Returns <a href=\"#ownedgifts\">OwnedGifts</a> on success.</p>",
"rst_description": "Returns the gifts owned and hosted by a user. Returns :class:`aiogram.types.owned_gifts.OwnedGifts` on success.",
"annotations": [
{
"type": "Integer",
"required": true,
"description": "Unique identifier of the user",
"html_description": "<td>Unique identifier of the user</td>",
"rst_description": "Unique identifier of the user\n",
"name": "user_id"
},
{
"type": "Boolean",
"required": false,
"description": "Pass True to exclude gifts that can be purchased an unlimited number of times",
"html_description": "<td>Pass <em>True</em> to exclude gifts that can be purchased an unlimited number of times</td>",
"rst_description": "Pass :code:`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 and can be upgraded to unique",
"html_description": "<td>Pass <em>True</em> to exclude gifts that can be purchased a limited number of times and can be upgraded to unique</td>",
"rst_description": "Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can be upgraded to unique\n",
"name": "exclude_limited_upgradable"
},
{
"type": "Boolean",
"required": false,
"description": "Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique",
"html_description": "<td>Pass <em>True</em> to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique</td>",
"rst_description": "Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique\n",
"name": "exclude_limited_non_upgradable"
},
{
"type": "Boolean",
"required": false,
"description": "Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram",
"html_description": "<td>Pass <em>True</em> to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram</td>",
"rst_description": "Pass :code:`True` to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram\n",
"name": "exclude_from_blockchain"
},
{
"type": "Boolean",
"required": false,
"description": "Pass True to exclude unique gifts",
"html_description": "<td>Pass <em>True</em> to exclude unique gifts</td>",
"rst_description": "Pass :code:`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 <em>True</em> to sort results by gift price instead of send date. Sorting is applied before pagination.</td>",
"rst_description": "Pass :code:`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 an 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 an 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 an 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

@ -62,9 +62,9 @@
{
"type": "Boolean",
"required": false,
"description": "Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics",
"html_description": "<td>Pass <em>True</em> if the administrator can restrict, ban or unban chat members, or access supergroup statistics</td>",
"rst_description": "Pass :code:`True` if the administrator can restrict, ban or unban chat members, or access supergroup statistics\n",
"description": "Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics. For backward compatibility, defaults to True for promotions of channel administrators",
"html_description": "<td>Pass <em>True</em> if the administrator can restrict, ban or unban chat members, or access supergroup statistics. For backward compatibility, defaults to <em>True</em> for promotions of channel administrators</td>",
"rst_description": "Pass :code:`True` if the administrator can restrict, ban or unban chat members, or access supergroup statistics. For backward compatibility, defaults to :code:`True` for promotions of channel administrators\n",
"name": "can_restrict_members"
},
{

65
.butcher/methods/repostStory/entity.json generated Normal file
View file

@ -0,0 +1,65 @@
{
"meta": {},
"group": {
"title": "Available methods",
"anchor": "available-methods"
},
"object": {
"anchor": "repoststory",
"name": "repostStory",
"description": "Reposts a story on behalf of a business account from another business account. Both business accounts must be managed by the same bot, and the story on the source account must have been posted (or reposted) by the bot. Requires the can_manage_stories business bot right for both business accounts. Returns Story on success.",
"html_description": "<p>Reposts a story on behalf of a business account from another business account. Both business accounts must be managed by the same bot, and the story on the source account must have been posted (or reposted) by the bot. Requires the <em>can_manage_stories</em> business bot right for both business accounts. Returns <a href=\"#story\">Story</a> on success.</p>",
"rst_description": "Reposts a story on behalf of a business account from another business account. Both business accounts must be managed by the same bot, and the story on the source account must have been posted (or reposted) by the bot. Requires the *can_manage_stories* business bot right for both business accounts. Returns :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 chat which posted the story that should be reposted",
"html_description": "<td>Unique identifier of the chat which posted the story that should be reposted</td>",
"rst_description": "Unique identifier of the chat which posted the story that should be reposted\n",
"name": "from_chat_id"
},
{
"type": "Integer",
"required": true,
"description": "Unique identifier of the story that should be reposted",
"html_description": "<td>Unique identifier of the story that should be reposted</td>",
"rst_description": "Unique identifier of the story that should be reposted\n",
"name": "from_story_id"
},
{
"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": "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

@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
"description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
"html_description": "<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
"description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
"html_description": "<td>Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{

View file

@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
"description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
"html_description": "<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
"description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
"html_description": "<td>Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{

View file

@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
"description": "Unique identifier for the target message thread; for supergroups only",
"html_description": "<td>Unique identifier for the target message thread; for supergroups only</td>",
"rst_description": "Unique identifier for the target message thread; for supergroups only\n",
"description": "Unique identifier for the target message thread or topic of a forum; for supergroups and private chats of bots with forum topic mode enabled only",
"html_description": "<td>Unique identifier for the target message thread or topic of a forum; for supergroups and private chats of bots with forum topic mode enabled only</td>",
"rst_description": "Unique identifier for the target message thread or topic of a forum; for supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{

View file

@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
"description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
"html_description": "<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
"description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
"html_description": "<td>Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{

View file

@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
"description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
"html_description": "<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
"description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
"html_description": "<td>Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{

View file

@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
"description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
"html_description": "<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
"description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
"html_description": "<td>Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{

View file

@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
"description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
"html_description": "<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
"description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
"html_description": "<td>Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{

View file

@ -30,9 +30,9 @@
{
"type": "String",
"required": true,
"description": "Identifier of the gift",
"html_description": "<td>Identifier of the gift</td>",
"rst_description": "Identifier of the gift\n",
"description": "Identifier of the gift; limited gifts can't be sent to channel chats",
"html_description": "<td>Identifier of the gift; limited gifts can't be sent to channel chats</td>",
"rst_description": "Identifier of the gift; limited gifts can't be sent to channel chats\n",
"name": "gift_id"
},
{

View file

@ -22,9 +22,9 @@
{
"type": "Integer",
"required": false,
"description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
"html_description": "<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
"description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
"html_description": "<td>Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{

View file

@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
"description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
"html_description": "<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
"description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
"html_description": "<td>Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{

View file

@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
"description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
"html_description": "<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
"description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
"html_description": "<td>Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{

View file

@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
"description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
"html_description": "<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
"description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
"html_description": "<td>Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{

View file

@ -0,0 +1,65 @@
{
"meta": {},
"group": {
"title": "Available methods",
"anchor": "available-methods"
},
"object": {
"anchor": "sendmessagedraft",
"name": "sendMessageDraft",
"description": "Use this method to stream a partial message to a user while the message is being generated; supported only for bots with forum topic mode enabled. Returns True on success.",
"html_description": "<p>Use this method to stream a partial message to a user while the message is being generated; supported only for bots with forum topic mode enabled. Returns <em>True</em> on success.</p>",
"rst_description": "Use this method to stream a partial message to a user while the message is being generated; supported only for bots with forum topic mode enabled. Returns :code:`True` on success.",
"annotations": [
{
"type": "Integer",
"required": true,
"description": "Unique identifier for the target private chat",
"html_description": "<td>Unique identifier for the target private chat</td>",
"rst_description": "Unique identifier for the target private chat\n",
"name": "chat_id"
},
{
"type": "Integer",
"required": false,
"description": "Unique identifier for the target message thread",
"html_description": "<td>Unique identifier for the target message thread</td>",
"rst_description": "Unique identifier for the target message thread\n",
"name": "message_thread_id"
},
{
"type": "Integer",
"required": true,
"description": "Unique identifier of the message draft; must be non-zero. Changes of drafts with the same identifier are animated",
"html_description": "<td>Unique identifier of the message draft; must be non-zero. Changes of drafts with the same identifier are animated</td>",
"rst_description": "Unique identifier of the message draft; must be non-zero. Changes of drafts with the same identifier are animated\n",
"name": "draft_id"
},
{
"type": "String",
"required": true,
"description": "Text of the message to be sent, 1-4096 characters after entities parsing",
"html_description": "<td>Text of the message to be sent, 1-4096 characters after entities parsing</td>",
"rst_description": "Text of the message to be sent, 1-4096 characters after entities parsing\n",
"name": "text"
},
{
"type": "String",
"required": false,
"description": "Mode for parsing entities in the message text. See formatting options for more details.",
"html_description": "<td>Mode for parsing entities in the message text. See <a href=\"#formatting-options\">formatting options</a> for more details.</td>",
"rst_description": "Mode for parsing entities in the message text. 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 message text, which can be specified instead of parse_mode",
"html_description": "<td>A JSON-serialized list of special entities that appear in message text, which can be specified instead of <em>parse_mode</em></td>",
"rst_description": "A JSON-serialized list of special entities that appear in message text, which can be specified instead of *parse_mode*\n",
"name": "entities"
}
],
"category": "methods"
}
}

View file

@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
"description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
"html_description": "<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
"description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
"html_description": "<td>Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
@ -46,9 +46,9 @@
{
"type": "Integer",
"required": true,
"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-10000</td>",
"rst_description": "The number of Telegram Stars that must be paid to buy access to the media; 1-10000\n",
"description": "The number of Telegram Stars that must be paid to buy access to the media; 1-25000",
"html_description": "<td>The number of Telegram Stars that must be paid to buy access to the media; 1-25000</td>",
"rst_description": "The number of Telegram Stars that must be paid to buy access to the media; 1-25000\n",
"name": "star_count"
},
{

View file

@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
"description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
"html_description": "<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
"description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
"html_description": "<td>Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{

View file

@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
"description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
"html_description": "<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
"description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
"html_description": "<td>Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{

View file

@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
"description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
"html_description": "<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
"description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
"html_description": "<td>Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{

View file

@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
"description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
"html_description": "<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
"description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
"html_description": "<td>Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{

View file

@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
"description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
"html_description": "<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
"description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
"html_description": "<td>Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{

View file

@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
"description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
"html_description": "<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
"description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
"html_description": "<td>Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{

View file

@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
"description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
"html_description": "<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
"description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
"html_description": "<td>Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only</td>",
"rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{

View file

@ -7,9 +7,9 @@
"object": {
"anchor": "unpinallforumtopicmessages",
"name": "unpinAllForumTopicMessages",
"description": "Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.",
"html_description": "<p>Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the <em>can_pin_messages</em> administrator right in the supergroup. Returns <em>True</em> on success.</p>",
"rst_description": "Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the *can_pin_messages* administrator right in the supergroup. Returns :code:`True` on success.",
"description": "Use this method to clear the list of pinned messages in a forum topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.",
"html_description": "<p>Use this method to clear the list of pinned messages in a forum topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the <em>can_pin_messages</em> administrator right in the supergroup. Returns <em>True</em> on success.</p>",
"rst_description": "Use this method to clear the list of pinned messages in a forum topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the *can_pin_messages* administrator right in the supergroup. Returns :code:`True` on success.",
"annotations": [
{
"type": "Integer or String",

File diff suppressed because it is too large Load diff

View file

@ -42,6 +42,14 @@
"rst_description": ":code:`True`, if a Telegram Premium subscription is accepted\n",
"name": "premium_subscription",
"required": true
},
{
"type": "Boolean",
"description": "True, if transfers of unique gifts from channels are accepted",
"html_description": "<td><em>True</em>, if transfers of unique gifts from channels are accepted</td>",
"rst_description": ":code:`True`, if transfers of unique gifts from channels are accepted\n",
"name": "gifts_from_channels",
"required": true
}
],
"category": "types"

View file

@ -387,6 +387,30 @@
"name": "location",
"required": false
},
{
"type": "UserRating",
"description": "For private chats, the rating of the user if any",
"html_description": "<td><em>Optional</em>. For private chats, the rating of the user if any</td>",
"rst_description": "*Optional*. For private chats, the rating of the user if any\n",
"name": "rating",
"required": false
},
{
"type": "UniqueGiftColors",
"description": "The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews",
"html_description": "<td><em>Optional</em>. The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews</td>",
"rst_description": "*Optional*. The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews\n",
"name": "unique_gift_colors",
"required": false
},
{
"type": "Integer",
"description": "The number of Telegram Stars a general user have to pay to send a message to the chat",
"html_description": "<td><em>Optional</em>. The number of Telegram Stars a general user have to pay to send a message to the chat</td>",
"rst_description": "*Optional*. The number of Telegram Stars a general user have to pay to send a message to the chat\n",
"name": "paid_message_star_count",
"required": false
},
{
"type": "True",
"description": "True, if gifts can be sent to the chat",

View file

@ -37,12 +37,20 @@
},
{
"type": "User",
"description": "User that completed the task; omitted if the task wasn't completed",
"html_description": "<td><em>Optional</em>. User that completed the task; omitted if the task wasn't completed</td>",
"rst_description": "*Optional*. User that completed the task; omitted if the task wasn't completed\n",
"description": "User that completed the task; omitted if the task wasn't completed by a user",
"html_description": "<td><em>Optional</em>. User that completed the task; omitted if the task wasn't completed by a user</td>",
"rst_description": "*Optional*. User that completed the task; omitted if the task wasn't completed by a user\n",
"name": "completed_by_user",
"required": false
},
{
"type": "Chat",
"description": "Chat that completed the task; omitted if the task wasn't completed by a chat",
"html_description": "<td><em>Optional</em>. Chat that completed the task; omitted if the task wasn't completed by a chat</td>",
"rst_description": "*Optional*. Chat that completed the task; omitted if the task wasn't completed by a chat\n",
"name": "completed_by_chat",
"required": false
},
{
"type": "Integer",
"description": "Point in time (Unix timestamp) when the task was completed; 0 if the task wasn't completed",

View file

@ -13,9 +13,9 @@
"annotations": [
{
"type": "Integer",
"description": "Unique identifier of the topic",
"html_description": "<td>Unique identifier of the topic</td>",
"rst_description": "Unique identifier of the topic\n",
"description": "Unique identifier of the topic. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.",
"html_description": "<td>Unique identifier of the topic. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.</td>",
"rst_description": "Unique identifier of the topic. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.\n",
"name": "topic_id",
"required": true
},

View file

@ -42,6 +42,14 @@
"rst_description": "*Optional*. Unique identifier of the custom emoji shown as the topic icon\n",
"name": "icon_custom_emoji_id",
"required": false
},
{
"type": "True",
"description": "True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot",
"html_description": "<td><em>Optional</em>. <em>True</em>, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot</td>",
"rst_description": "*Optional*. :code:`True`, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot\n",
"name": "is_name_implicit",
"required": false
}
],
"category": "types"

View file

@ -34,6 +34,14 @@
"rst_description": "*Optional*. Unique identifier of the custom emoji shown as the topic icon\n",
"name": "icon_custom_emoji_id",
"required": false
},
{
"type": "True",
"description": "True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot",
"html_description": "<td><em>Optional</em>. <em>True</em>, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot</td>",
"rst_description": "*Optional*. :code:`True`, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot\n",
"name": "is_name_implicit",
"required": false
}
],
"category": "types"

View file

@ -43,22 +43,70 @@
"name": "upgrade_star_count",
"required": false
},
{
"type": "True",
"description": "True, if the gift can only be purchased by Telegram Premium subscribers",
"html_description": "<td><em>Optional</em>. <em>True</em>, if the gift can only be purchased by Telegram Premium subscribers</td>",
"rst_description": "*Optional*. :code:`True`, if the gift can only be purchased by Telegram Premium subscribers\n",
"name": "is_premium",
"required": false
},
{
"type": "True",
"description": "True, if the gift can be used (after being upgraded) to customize a user's appearance",
"html_description": "<td><em>Optional</em>. <em>True</em>, if the gift can be used (after being upgraded) to customize a user's appearance</td>",
"rst_description": "*Optional*. :code:`True`, if the gift can be used (after being upgraded) to customize a user's appearance\n",
"name": "has_colors",
"required": false
},
{
"type": "Integer",
"description": "The total number of the gifts of this type that can be sent; for limited gifts only",
"html_description": "<td><em>Optional</em>. The total number of the gifts of this type that can be sent; for limited gifts only</td>",
"rst_description": "*Optional*. The total number of the gifts of this type that can be sent; for limited gifts only\n",
"description": "The total number of gifts of this type that can be sent by all users; for limited gifts only",
"html_description": "<td><em>Optional</em>. The total number of gifts of this type that can be sent by all users; for limited gifts only</td>",
"rst_description": "*Optional*. The total number of gifts of this type that can be sent by all users; for limited gifts only\n",
"name": "total_count",
"required": false
},
{
"type": "Integer",
"description": "The number of remaining gifts of this type that can be sent; for limited gifts only",
"html_description": "<td><em>Optional</em>. The number of remaining gifts of this type that can be sent; for limited gifts only</td>",
"rst_description": "*Optional*. The number of remaining gifts of this type that can be sent; for limited gifts only\n",
"description": "The number of remaining gifts of this type that can be sent by all users; for limited gifts only",
"html_description": "<td><em>Optional</em>. The number of remaining gifts of this type that can be sent by all users; for limited gifts only</td>",
"rst_description": "*Optional*. The number of remaining gifts of this type that can be sent by all users; for limited gifts only\n",
"name": "remaining_count",
"required": false
},
{
"type": "Integer",
"description": "The total number of gifts of this type that can be sent by the bot; for limited gifts only",
"html_description": "<td><em>Optional</em>. The total number of gifts of this type that can be sent by the bot; for limited gifts only</td>",
"rst_description": "*Optional*. The total number of gifts of this type that can be sent by the bot; for limited gifts only\n",
"name": "personal_total_count",
"required": false
},
{
"type": "Integer",
"description": "The number of remaining gifts of this type that can be sent by the bot; for limited gifts only",
"html_description": "<td><em>Optional</em>. The number of remaining gifts of this type that can be sent by the bot; for limited gifts only</td>",
"rst_description": "*Optional*. The number of remaining gifts of this type that can be sent by the bot; for limited gifts only\n",
"name": "personal_remaining_count",
"required": false
},
{
"type": "GiftBackground",
"description": "Background of the gift",
"html_description": "<td><em>Optional</em>. Background of the gift</td>",
"rst_description": "*Optional*. Background of the gift\n",
"name": "background",
"required": false
},
{
"type": "Integer",
"description": "The total number of different unique gifts that can be obtained by upgrading the gift",
"html_description": "<td><em>Optional</em>. The total number of different unique gifts that can be obtained by upgrading the gift</td>",
"rst_description": "*Optional*. The total number of different unique gifts that can be obtained by upgrading the gift\n",
"name": "unique_gift_variant_count",
"required": false
},
{
"type": "Chat",
"description": "Information about the chat that published the gift",

View file

@ -0,0 +1,41 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "giftbackground",
"name": "GiftBackground",
"description": "This object describes the background of a gift.",
"html_description": "<p>This object describes the background of a gift.</p>",
"rst_description": "This object describes the background of a gift.",
"annotations": [
{
"type": "Integer",
"description": "Center color of the background in RGB format",
"html_description": "<td>Center color of the background in RGB format</td>",
"rst_description": "Center color of the background in RGB format\n",
"name": "center_color",
"required": true
},
{
"type": "Integer",
"description": "Edge color of the background in RGB format",
"html_description": "<td>Edge color of the background in RGB format</td>",
"rst_description": "Edge color of the background in RGB format\n",
"name": "edge_color",
"required": true
},
{
"type": "Integer",
"description": "Text color of the background in RGB format",
"html_description": "<td>Text color of the background in RGB format</td>",
"rst_description": "Text color of the background in RGB format\n",
"name": "text_color",
"required": true
}
],
"category": "types"
}
}

View file

@ -37,12 +37,20 @@
},
{
"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",
"description": "Number of Telegram Stars that were prepaid for the ability to upgrade the gift",
"html_description": "<td><em>Optional</em>. Number of Telegram Stars that were prepaid for the ability to upgrade the gift</td>",
"rst_description": "*Optional*. Number of Telegram Stars that were prepaid for the ability to upgrade the gift\n",
"name": "prepaid_upgrade_star_count",
"required": false
},
{
"type": "True",
"description": "True, if the gift's upgrade was purchased after the gift was sent",
"html_description": "<td><em>Optional</em>. <em>True</em>, if the gift's upgrade was purchased after the gift was sent</td>",
"rst_description": "*Optional*. :code:`True`, if the gift's upgrade was purchased after the gift was sent\n",
"name": "is_upgrade_separate",
"required": false
},
{
"type": "True",
"description": "True, if the gift can be upgraded to a unique gift",
@ -74,6 +82,14 @@
"rst_description": "*Optional*. :code:`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": "Integer",
"description": "Unique number reserved for this gift when upgraded. See the number field in UniqueGift",
"html_description": "<td><em>Optional</em>. Unique number reserved for this gift when upgraded. See the <em>number</em> field in <a href=\"#uniquegift\">UniqueGift</a></td>",
"rst_description": "*Optional*. Unique number reserved for this gift when upgraded. See the *number* field in :class:`aiogram.types.unique_gift.UniqueGift`\n",
"name": "unique_gift_number",
"required": false
}
],
"category": "types"

View file

@ -22,8 +22,8 @@
{
"type": "String",
"description": "Mode for parsing entities in the title. See formatting options for more details.",
"html_description": "<td>Optional. Mode for parsing entities in the title. See <a href=\"#formatting-options\">formatting options</a> for more details.</td>",
"rst_description": "Optional. Mode for parsing entities in the title. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.\n",
"html_description": "<td><em>Optional</em>. Mode for parsing entities in the title. See <a href=\"#formatting-options\">formatting options</a> for more details.</td>",
"rst_description": "*Optional*. Mode for parsing entities in the title. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.\n",
"name": "parse_mode",
"required": false
},

View file

@ -30,8 +30,8 @@
{
"type": "String",
"description": "Mode for parsing entities in the text. See formatting options for more details.",
"html_description": "<td>Optional. Mode for parsing entities in the text. See <a href=\"https://core.telegram.org/bots/api#formatting-options\">formatting options</a> for more details.</td>",
"rst_description": "Optional. Mode for parsing entities in the text. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.\n",
"html_description": "<td><em>Optional</em>. Mode for parsing entities in the text. See <a href=\"https://core.telegram.org/bots/api#formatting-options\">formatting options</a> for more details.</td>",
"rst_description": "*Optional*. Mode for parsing entities in the text. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.\n",
"name": "parse_mode",
"required": false
},

View file

@ -22,16 +22,16 @@
{
"type": "KeyboardButtonRequestUsers",
"description": "If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a 'users_shared' service message. Available in private chats only.",
"html_description": "<td><em>Optional.</em> If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a &#8220;users_shared&#8221; service message. Available in private chats only.</td>",
"rst_description": "*Optional.* If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a 'users_shared' service message. Available in private chats only.\n",
"html_description": "<td><em>Optional</em>. If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a &#8220;users_shared&#8221; service message. Available in private chats only.</td>",
"rst_description": "*Optional*. If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a 'users_shared' service message. Available in private chats only.\n",
"name": "request_users",
"required": false
},
{
"type": "KeyboardButtonRequestChat",
"description": "If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a 'chat_shared' service message. Available in private chats only.",
"html_description": "<td><em>Optional.</em> If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a &#8220;chat_shared&#8221; service message. Available in private chats only.</td>",
"rst_description": "*Optional.* If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a 'chat_shared' service message. Available in private chats only.\n",
"html_description": "<td><em>Optional</em>. If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a &#8220;chat_shared&#8221; service message. Available in private chats only.</td>",
"rst_description": "*Optional*. If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a 'chat_shared' service message. Available in private chats only.\n",
"name": "request_chat",
"required": false
},

View file

@ -21,9 +21,9 @@
},
{
"type": "Integer",
"description": "Unique identifier of a message thread to which the message belongs; for supergroups only",
"html_description": "<td><em>Optional</em>. Unique identifier of a message thread to which the message belongs; for supergroups only</td>",
"rst_description": "*Optional*. Unique identifier of a message thread to which the message belongs; for supergroups only\n",
"description": "Unique identifier of a message thread or forum topic to which the message belongs; for supergroups and private chats only",
"html_description": "<td><em>Optional</em>. Unique identifier of a message thread or forum topic to which the message belongs; for supergroups and private chats only</td>",
"rst_description": "*Optional*. Unique identifier of a message thread or forum topic to which the message belongs; for supergroups and private chats only\n",
"name": "message_thread_id",
"required": false
},
@ -101,9 +101,9 @@
},
{
"type": "True",
"description": "True, if the message is sent to a forum topic",
"html_description": "<td><em>Optional</em>. <em>True</em>, if the message is sent to a forum topic</td>",
"rst_description": "*Optional*. :code:`True`, if the message is sent to a forum topic\n",
"description": "True, if the message is sent to a topic in a forum supergroup or a private chat with the bot",
"html_description": "<td><em>Optional</em>. <em>True</em>, if the message is sent to a topic in a forum supergroup or a private chat with the bot</td>",
"rst_description": "*Optional*. :code:`True`, if the message is sent to a topic in a forum supergroup or a private chat with the bot\n",
"name": "is_topic_message",
"required": false
},
@ -579,6 +579,14 @@
"name": "unique_gift",
"required": false
},
{
"type": "GiftInfo",
"description": "Service message: upgrade of a gift was purchased after the gift was sent",
"html_description": "<td><em>Optional</em>. Service message: upgrade of a gift was purchased after the gift was sent</td>",
"rst_description": "*Optional*. Service message: upgrade of a gift was purchased after the gift was sent\n",
"name": "gift_upgrade_sent",
"required": false
},
{
"type": "String",
"description": "The domain name of the website on which the user has logged in.",

View file

@ -101,19 +101,35 @@
},
{
"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",
"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; for gifts received on behalf of business accounts only",
"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; for gifts received on behalf of business accounts only</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; for gifts received on behalf of business accounts only\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",
"description": "Number of Telegram Stars that were paid for the ability to upgrade the gift",
"html_description": "<td><em>Optional</em>. Number of Telegram Stars that were paid for the ability to upgrade the gift</td>",
"rst_description": "*Optional*. Number of Telegram Stars that were paid for the ability to upgrade the gift\n",
"name": "prepaid_upgrade_star_count",
"required": false
},
{
"type": "True",
"description": "True, if the gift's upgrade was purchased after the gift was sent; for gifts received on behalf of business accounts only",
"html_description": "<td><em>Optional</em>. <em>True</em>, if the gift's upgrade was purchased after the gift was sent; for gifts received on behalf of business accounts only</td>",
"rst_description": "*Optional*. :code:`True`, if the gift's upgrade was purchased after the gift was sent; for gifts received on behalf of business accounts only\n",
"name": "is_upgrade_separate",
"required": false
},
{
"type": "Integer",
"description": "Unique number reserved for this gift when upgraded. See the number field in UniqueGift",
"html_description": "<td><em>Optional</em>. Unique number reserved for this gift when upgraded. See the <em>number</em> field in <a href=\"#uniquegift\">UniqueGift</a></td>",
"rst_description": "*Optional*. Unique number reserved for this gift when upgraded. See the *number* field in :class:`aiogram.types.unique_gift.UniqueGift`\n",
"name": "unique_gift_number",
"required": false
}
],
"category": "types"

View file

@ -7,9 +7,9 @@
"object": {
"anchor": "suggestedpostprice",
"name": "SuggestedPostPrice",
"description": "Desribes price of a suggested post.",
"html_description": "<p>Desribes price of a suggested post.</p>",
"rst_description": "Desribes price of a suggested post.",
"description": "Describes the price of a suggested post.",
"html_description": "<p>Describes the price of a suggested post.</p>",
"rst_description": "Describes the price of a suggested post.",
"annotations": [
{
"type": "String",

View file

@ -11,6 +11,14 @@
"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": "Identifier of the regular gift from which the gift was upgraded",
"html_description": "<td>Identifier of the regular gift from which the gift was upgraded</td>",
"rst_description": "Identifier of the regular gift from which the gift was upgraded\n",
"name": "gift_id",
"required": true
},
{
"type": "String",
"description": "Human-readable name of the regular gift from which this unique gift was upgraded",
@ -59,6 +67,30 @@
"name": "backdrop",
"required": true
},
{
"type": "True",
"description": "True, if the original regular gift was exclusively purchaseable by Telegram Premium subscribers",
"html_description": "<td><em>Optional</em>. <em>True</em>, if the original regular gift was exclusively purchaseable by Telegram Premium subscribers</td>",
"rst_description": "*Optional*. :code:`True`, if the original regular gift was exclusively purchaseable by Telegram Premium subscribers\n",
"name": "is_premium",
"required": false
},
{
"type": "True",
"description": "True, if the gift is assigned from the TON blockchain and can't be resold or transferred in Telegram",
"html_description": "<td><em>Optional</em>. <em>True</em>, if the gift is assigned from the TON blockchain and can't be resold or transferred in Telegram</td>",
"rst_description": "*Optional*. :code:`True`, if the gift is assigned from the TON blockchain and can't be resold or transferred in Telegram\n",
"name": "is_from_blockchain",
"required": false
},
{
"type": "UniqueGiftColors",
"description": "The color scheme that can be used by the gift's owner for the chat's name, replies to messages and link previews; for business account gifts and gifts that are currently on sale only",
"html_description": "<td><em>Optional</em>. The color scheme that can be used by the gift's owner for the chat's name, replies to messages and link previews; for business account gifts and gifts that are currently on sale only</td>",
"rst_description": "*Optional*. The color scheme that can be used by the gift's owner for the chat's name, replies to messages and link previews; for business account gifts and gifts that are currently on sale only\n",
"name": "colors",
"required": false
},
{
"type": "Chat",
"description": "Information about the chat that published the gift",

View file

@ -0,0 +1,65 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "uniquegiftcolors",
"name": "UniqueGiftColors",
"description": "This object contains information about the color scheme for a user's name, message replies and link previews based on a unique gift.",
"html_description": "<p>This object contains information about the color scheme for a user's name, message replies and link previews based on a unique gift.</p>",
"rst_description": "This object contains information about the color scheme for a user's name, message replies and link previews based on a unique gift.",
"annotations": [
{
"type": "String",
"description": "Custom emoji identifier of the unique gift's model",
"html_description": "<td>Custom emoji identifier of the unique gift's model</td>",
"rst_description": "Custom emoji identifier of the unique gift's model\n",
"name": "model_custom_emoji_id",
"required": true
},
{
"type": "String",
"description": "Custom emoji identifier of the unique gift's symbol",
"html_description": "<td>Custom emoji identifier of the unique gift's symbol</td>",
"rst_description": "Custom emoji identifier of the unique gift's symbol\n",
"name": "symbol_custom_emoji_id",
"required": true
},
{
"type": "Integer",
"description": "Main color used in light themes; RGB format",
"html_description": "<td>Main color used in light themes; RGB format</td>",
"rst_description": "Main color used in light themes; RGB format\n",
"name": "light_theme_main_color",
"required": true
},
{
"type": "Array of Integer",
"description": "List of 1-3 additional colors used in light themes; RGB format",
"html_description": "<td>List of 1-3 additional colors used in light themes; RGB format</td>",
"rst_description": "List of 1-3 additional colors used in light themes; RGB format\n",
"name": "light_theme_other_colors",
"required": true
},
{
"type": "Integer",
"description": "Main color used in dark themes; RGB format",
"html_description": "<td>Main color used in dark themes; RGB format</td>",
"rst_description": "Main color used in dark themes; RGB format\n",
"name": "dark_theme_main_color",
"required": true
},
{
"type": "Array of Integer",
"description": "List of 1-3 additional colors used in dark themes; RGB format",
"html_description": "<td>List of 1-3 additional colors used in dark themes; RGB format</td>",
"rst_description": "List of 1-3 additional colors used in dark themes; RGB format\n",
"name": "dark_theme_other_colors",
"required": true
}
],
"category": "types"
}
}

View file

@ -21,18 +21,26 @@
},
{
"type": "String",
"description": "Origin of the gift. Currently, either 'upgrade' for gifts upgraded from regular gifts, 'transfer' for gifts transferred from other users or channels, or 'resale' for gifts bought from other users",
"html_description": "<td>Origin of the gift. Currently, either &#8220;upgrade&#8221; for gifts upgraded from regular gifts, &#8220;transfer&#8221; for gifts transferred from other users or channels, or &#8220;resale&#8221; for gifts bought from other users</td>",
"rst_description": "Origin of the gift. Currently, either 'upgrade' for gifts upgraded from regular gifts, 'transfer' for gifts transferred from other users or channels, or 'resale' for gifts bought from other users\n",
"description": "Origin of the gift. Currently, either 'upgrade' for gifts upgraded from regular gifts, 'transfer' for gifts transferred from other users or channels, 'resale' for gifts bought from other users, 'gifted_upgrade' for upgrades purchased after the gift was sent, or 'offer' for gifts bought or sold through gift purchase offers",
"html_description": "<td>Origin of the gift. Currently, either &#8220;upgrade&#8221; for gifts upgraded from regular gifts, &#8220;transfer&#8221; for gifts transferred from other users or channels, &#8220;resale&#8221; for gifts bought from other users, &#8220;gifted_upgrade&#8221; for upgrades purchased after the gift was sent, or &#8220;offer&#8221; for gifts bought or sold through gift purchase offers</td>",
"rst_description": "Origin of the gift. Currently, either 'upgrade' for gifts upgraded from regular gifts, 'transfer' for gifts transferred from other users or channels, 'resale' for gifts bought from other users, 'gifted_upgrade' for upgrades purchased after the gift was sent, or 'offer' for gifts bought or sold through gift purchase offers\n",
"name": "origin",
"required": true
},
{
"type": "String",
"description": "For gifts bought from other users, the currency in which the payment for the gift was done. Currently, one of 'XTR' for Telegram Stars or 'TON' for toncoins.",
"html_description": "<td><em>Optional</em>. For gifts bought from other users, the currency in which the payment for the gift was done. Currently, one of &#8220;XTR&#8221; for Telegram Stars or &#8220;TON&#8221; for toncoins.</td>",
"rst_description": "*Optional*. For gifts bought from other users, the currency in which the payment for the gift was done. Currently, one of 'XTR' for Telegram Stars or 'TON' for toncoins.\n",
"name": "last_resale_currency",
"required": false
},
{
"type": "Integer",
"description": "For gifts bought from other users, the price paid for the gift",
"html_description": "<td><em>Optional</em>. For gifts bought from other users, the price paid for the gift</td>",
"rst_description": "*Optional*. For gifts bought from other users, the price paid for the gift\n",
"name": "last_resale_star_count",
"description": "For gifts bought from other users, the price paid for the gift in either Telegram Stars or nanotoncoins",
"html_description": "<td><em>Optional</em>. For gifts bought from other users, the price paid for the gift in either Telegram Stars or nanotoncoins</td>",
"rst_description": "*Optional*. For gifts bought from other users, the price paid for the gift in either Telegram Stars or nanotoncoins\n",
"name": "last_resale_amount",
"required": false
},
{
@ -58,6 +66,18 @@
"rst_description": "*Optional*. Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now\n",
"name": "next_transfer_date",
"required": false
},
{
"type": "Integer",
"description": "For gifts bought from other users, the price paid for the gift",
"html_description": "<td><em>Optional</em>. For gifts bought from other users, the price paid for the gift</td>",
"rst_description": "*Optional*. For gifts bought from other users, the price paid for the gift\n",
"name": "last_resale_star_count",
"required": false,
"deprecated": {
"version": "9.3",
"release_date": "2025-12-31"
}
}
],
"category": "types"

View file

@ -114,6 +114,14 @@
"rst_description": "*Optional*. :code:`True`, if the bot has a main Web App. Returned only in :class:`aiogram.methods.get_me.GetMe`.\n",
"name": "has_main_web_app",
"required": false
},
{
"type": "Boolean",
"description": "True, if the bot has forum topic mode enabled in private chats. Returned only in getMe.",
"html_description": "<td><em>Optional</em>. <em>True</em>, if the bot has forum topic mode enabled in private chats. Returned only in <a href=\"#getme\">getMe</a>.</td>",
"rst_description": "*Optional*. :code:`True`, if the bot has forum topic mode enabled in private chats. Returned only in :class:`aiogram.methods.get_me.GetMe`.\n",
"name": "has_topics_enabled",
"required": false
}
],
"category": "types"

49
.butcher/types/UserRating/entity.json generated Normal file
View file

@ -0,0 +1,49 @@
{
"meta": {},
"group": {
"title": "Available types",
"anchor": "available-types"
},
"object": {
"anchor": "userrating",
"name": "UserRating",
"description": "This object describes the rating of a user based on their Telegram Star spendings.",
"html_description": "<p>This object describes the rating of a user based on their Telegram Star spendings.</p>",
"rst_description": "This object describes the rating of a user based on their Telegram Star spendings.",
"annotations": [
{
"type": "Integer",
"description": "Current level of the user, indicating their reliability when purchasing digital goods and services. A higher level suggests a more trustworthy customer; a negative level is likely reason for concern.",
"html_description": "<td>Current level of the user, indicating their reliability when purchasing digital goods and services. A higher level suggests a more trustworthy customer; a negative level is likely reason for concern.</td>",
"rst_description": "Current level of the user, indicating their reliability when purchasing digital goods and services. A higher level suggests a more trustworthy customer; a negative level is likely reason for concern.\n",
"name": "level",
"required": true
},
{
"type": "Integer",
"description": "Numerical value of the user's rating; the higher the rating, the better",
"html_description": "<td>Numerical value of the user's rating; the higher the rating, the better</td>",
"rst_description": "Numerical value of the user's rating; the higher the rating, the better\n",
"name": "rating",
"required": true
},
{
"type": "Integer",
"description": "The rating value required to get the current level",
"html_description": "<td>The rating value required to get the current level</td>",
"rst_description": "The rating value required to get the current level\n",
"name": "current_level_rating",
"required": true
},
{
"type": "Integer",
"description": "The rating value required to get to the next level; omitted if the maximum level was reached",
"html_description": "<td><em>Optional</em>. The rating value required to get to the next level; omitted if the maximum level was reached</td>",
"rst_description": "*Optional*. The rating value required to get to the next level; omitted if the maximum level was reached\n",
"name": "next_level_rating",
"required": false
}
],
"category": "types"
}
}

1
.github/FUNDING.yml vendored
View file

@ -1,2 +1 @@
open_collective: aiogram

View file

@ -10,25 +10,22 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Set up Python 3.11
uses: actions/setup-python@v5
- name: Set up Python 3.14
uses: actions/setup-python@v6
with:
python-version: "3.11"
python-version: "3.14"
- name: Install build dependencies
run: python -m pip install --upgrade build
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Resolve version
id: package-version
run: echo "value=$(echo ${{ github.ref }} | sed -e 's/refs\/tags\/v//')" >> $GITHUB_OUTPUT
# - name: Bump version
# run: hatch version ${{ steps.package-version.outputs.value }}
- name: Build source distribution
run: python -m build .
- name: Build distribution
run: uv build
- name: Try install wheel
run: |
@ -39,7 +36,7 @@ jobs:
venv/bin/pip install ../dist/aiogram-*.whl
venv/bin/python -c "import aiogram; print(aiogram.__version__)"
- name: Publish artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: dist
path: dist/*
@ -55,7 +52,7 @@ jobs:
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v7
with:
name: dist
path: dist

View file

@ -58,18 +58,21 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: pyproject.toml
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install project dependencies
run: |
pip install -e .[dev,test,redis,mongo,proxy,i18n,fast,signature]
uv sync --all-extras --group dev --group test
- name: Lint code
run: |
ruff check --output-format=github aiogram examples
mypy aiogram
black --check --diff aiogram tests
uv run ruff check --output-format=github aiogram examples
uv run mypy aiogram
uv run black --check --diff aiogram tests
- name: Setup redis
if: ${{ env.IS_WINDOWS == 'false' }}
@ -91,10 +94,10 @@ jobs:
flags="$flags --cov=aiogram --cov-config .coveragerc --cov-report=xml"
[[ "$IS_WINDOWS" == "false" ]] && flags="$flags --redis redis://localhost:6379/0"
[[ "$IS_UBUNTU" == "true" ]] && flags="$flags --mongo mongodb://mongo:mongo@localhost:27017"
pytest $flags
uv run pytest $flags
- name: Upload coverage data
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
@ -123,20 +126,23 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: pyproject.toml
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install project dependencies
run: |
pip install -e .[dev,test,redis,mongo,proxy,i18n,fast,signature]
uv sync --all-extras --group dev --group test
- name: Run tests
run: |
flags=""
pytest $flags
uv run pytest $flags

View file

@ -16,6 +16,96 @@ Changelog
.. towncrier release notes start
3.24.0 (2026-01-02)
====================
Features
--------
- Added full support for Telegram Bot API 9.3
**Topics in Private Chats**
Bot API 9.3 introduces forum topics functionality for private chats:
- Added new ``sendMessageDraft`` method for streaming partial messages while being generated (requires forum topic mode enabled)
- Added ``has_topics_enabled`` field to the ``User`` class to determine if forum topic mode is enabled in private chats
- Added ``message_thread_id`` and ``is_topic_message`` fields to the ``Message`` class for private chat topic support
- Added ``message_thread_id`` parameter support to messaging methods: ``sendMessage``, ``sendPhoto``, ``sendVideo``, ``sendAnimation``, ``sendAudio``, ``sendDocument``, ``sendPaidMedia``, ``sendSticker``, ``sendVideoNote``, ``sendVoice``, ``sendLocation``, ``sendVenue``, ``sendContact``, ``sendPoll``, ``sendDice``, ``sendInvoice``, ``sendGame``, ``sendMediaGroup``, ``copyMessage``, ``copyMessages``, ``forwardMessage``, ``forwardMessages``
- Updated ``sendChatAction`` to support ``message_thread_id`` parameter in private chats
- Updated ``editForumTopic``, ``deleteForumTopic``, ``unpinAllForumTopicMessages`` methods to manage private chat topics
- Added ``is_name_implicit`` field to ``ForumTopic`` class
**Gifts System Enhancements**
Enhanced gifts functionality with new methods and extended capabilities:
- Added ``getUserGifts`` method to retrieve gifts owned and hosted by a user
- Added ``getChatGifts`` method to retrieve gifts owned by a chat
- Updated ``UniqueGiftInfo`` class: replaced ``last_resale_star_count`` with ``last_resale_currency`` and ``last_resale_amount`` fields, added "gifted_upgrade" and "offer" as origin values
- Updated ``getBusinessAccountGifts`` method: replaced ``exclude_limited`` parameter with ``exclude_limited_upgradable`` and ``exclude_limited_non_upgradable``, added ``exclude_from_blockchain`` parameter
- Added new fields to ``Gift`` class: ``personal_total_count``, ``personal_remaining_count``, ``is_premium``, ``has_colors``, ``unique_gift_variant_count``, ``gift_background``
- Added new fields to ``UniqueGift`` class: ``gift_id``, ``is_from_blockchain``, ``is_premium``, ``colors``
- Added new fields to gift info classes: ``is_upgrade_separate``, ``unique_gift_number``
- Added ``gift_upgrade_sent`` field to the ``Message`` class
- Added ``gifts_from_channels`` field to the ``AcceptedGiftTypes`` class
- Added new ``UniqueGiftColors`` class for color schemes in user names and link previews
- Added new ``GiftBackground`` class for gift background styling
**Business Accounts & Stories**
- Added ``repostStory`` method to enable reposting stories across managed business accounts
**Miscellaneous Updates**
- Bots can now disable main usernames and set ``can_restrict_members`` rights in channels
- Maximum paid media price increased to 25000 Telegram Stars
- Added new ``UserRating`` class
- Added ``rating``, ``paid_message_star_count``, ``unique_gift_colors`` fields to the ``ChatFullInfo`` class
- Added support for ``message_effect_id`` parameter in forward/copy operations
- Added ``completed_by_chat`` field to the ``ChecklistTask`` class
`#1747 <https://github.com/aiogram/aiogram/issues/1747>`_
Bugfixes
--------
- Fixed I18n initialization with relative path
`#1740 <https://github.com/aiogram/aiogram/issues/1740>`_
- Fixed dependency injection for arguments that have "ForwardRef" annotations in Py3.14+
since `inspect.getfullargspec(callback)` can't process callback if it's arguments have "ForwardRef" annotations
`#1741 <https://github.com/aiogram/aiogram/issues/1741>`_
Misc
----
- Migrated from ``hatch`` to ``uv`` for dependency management and development workflows.
This change improves developer experience with significantly faster dependency resolution (10-100x faster than pip), automatic virtual environment management, and reproducible builds through lockfile support.
**What changed for contributors:**
- Install dependencies with ``uv sync --all-extras --group dev --group test`` instead of ``pip install -e .[dev,test,docs]``
- Run commands with ``uv run`` prefix (e.g., ``uv run pytest``, ``uv run black``)
- All Makefile commands now use ``uv`` internally (``make install``, ``make test``, ``make lint``, etc.)
- Version bumping now uses a custom ``scripts/bump_version.py`` script instead of ``hatch version``
**What stayed the same:**
- Build backend remains ``hatchling`` (no changes to package building)
- Dynamic version reading from ``aiogram/__meta__.py`` still works
- All GitHub Actions CI/CD workflows updated to use ``uv``
- ReadTheDocs builds continue to work without changes
- Development dependencies (``dev``, ``test``) moved to ``[dependency-groups]`` section
- Documentation dependencies (``docs``) remain in ``[project.optional-dependencies]`` for compatibility
Contributors can use either the traditional ``pip``/``venv`` workflow or the new ``uv`` workflow - both are documented in the contributing guide.
`#1748 <https://github.com/aiogram/aiogram/issues/1748>`_
- Updated type hints in the codebase to Python 3.10+ style unions and optionals.
`#1749 <https://github.com/aiogram/aiogram/issues/1749>`_
3.23.0 (2025-12-07)
====================

View file

@ -28,8 +28,8 @@ clean:
.PHONY: install
install: clean
pip install -e ."[dev,test,docs]" -U --upgrade-strategy=eager
pre-commit install
uv sync --all-extras --group dev --group test
uv run pre-commit install
# =================================================================================================
# Code quality
@ -37,15 +37,15 @@ install: clean
.PHONY: lint
lint:
isort --check-only $(code_dir)
black --check --diff $(code_dir)
ruff check --show-fixes --preview $(package_dir) $(examples_dir)
mypy $(package_dir)
uv run isort --check-only $(code_dir)
uv run black --check --diff $(code_dir)
uv run ruff check --show-fixes --preview $(package_dir) $(examples_dir)
uv run mypy $(package_dir)
.PHONY: reformat
reformat:
black $(code_dir)
isort $(code_dir)
uv run black $(code_dir)
uv run isort $(code_dir)
# =================================================================================================
# Tests
@ -56,18 +56,18 @@ test-run-services:
.PHONY: test
test: test-run-services
pytest --cov=aiogram --cov-config .coveragerc tests/ --redis $(redis_connection) --mongo $(mongo_connection)
uv run pytest --cov=aiogram --cov-config .coveragerc tests/ --redis $(redis_connection) --mongo $(mongo_connection)
.PHONY: test-coverage
test-coverage: test-run-services
mkdir -p $(reports_dir)/tests/
pytest --cov=aiogram --cov-config .coveragerc --html=$(reports_dir)/tests/index.html tests/ --redis $(redis_connection) --mongo $(mongo_connection)
coverage html -d $(reports_dir)/coverage
uv run pytest --cov=aiogram --cov-config .coveragerc --html=$(reports_dir)/tests/index.html tests/ --redis $(redis_connection) --mongo $(mongo_connection)
uv run coverage html -d $(reports_dir)/coverage
.PHONY: test-coverage-view
test-coverage-view:
coverage html -d $(reports_dir)/coverage
python -c "import webbrowser; webbrowser.open('file://$(shell pwd)/reports/coverage/index.html')"
uv run coverage html -d $(reports_dir)/coverage
uv run python -c "import webbrowser; webbrowser.open('file://$(shell pwd)/reports/coverage/index.html')"
# =================================================================================================
# Docs
@ -79,12 +79,12 @@ locales_pot := _build/gettext
docs_dir := docs
docs-gettext:
hatch run docs:bash -c 'cd $(docs_dir) && make gettext'
hatch run docs:bash -c 'cd $(docs_dir) && sphinx-intl update -p $(locales_pot) $(addprefix -l , $(locales))'
uv run --extra docs bash -c 'cd $(docs_dir) && make gettext'
uv run --extra docs bash -c 'cd $(docs_dir) && sphinx-intl update -p $(locales_pot) $(addprefix -l , $(locales))'
.PHONY: docs-gettext
docs-serve:
hatch run docs:sphinx-autobuild --watch aiogram/ --watch CHANGES.rst --watch README.rst docs/ docs/_build/ $(OPTS)
uv run --extra docs sphinx-autobuild --watch aiogram/ --watch CHANGES.rst --watch README.rst docs/ docs/_build/ $(OPTS)
.PHONY: docs-serve
$(locale_targets): docs-serve-%:
@ -97,31 +97,31 @@ $(locale_targets): docs-serve-%:
.PHONY: build
build: clean
hatch build
uv build
.PHONY: bump
bump:
hatch version $(args)
python scripts/bump_versions.py
uv run python scripts/bump_version.py $(args)
uv run python scripts/bump_versions.py
update-api:
butcher parse
butcher refresh
butcher apply all
uv run --extra cli butcher parse
uv run --extra cli butcher refresh
uv run --extra cli butcher apply all
@$(MAKE) bump
.PHONY: towncrier-build
towncrier-build:
hatch run docs:towncrier build --yes
uv run --extra docs towncrier build --yes
.PHONY: towncrier-draft
towncrier-draft:
hatch run docs:towncrier build --draft
uv run --extra docs towncrier build --draft
.PHONY: towncrier-draft-github
towncrier-draft-github:
mkdir -p dist
hatch run docs:towncrier build --draft | pandoc - -o dist/release.md
uv run --extra docs towncrier build --draft | pandoc - -o dist/release.md
.PHONY: prepare-release
prepare-release: bump towncrier-build
@ -129,5 +129,5 @@ prepare-release: bump towncrier-build
.PHONY: release
release:
git add .
git commit -m "Release $(shell poetry version -s)"
git tag v$(shell hatch version -s)
git commit -m "Release $(shell uv run python -c 'from aiogram import __version__; print(__version__)')"
git tag v$(shell uv run python -c 'from aiogram import __version__; print(__version__)')

View file

@ -52,7 +52,7 @@ Features
- 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/>`_
- Supports `PyPy <https://www.pypy.org/>`_
- Supports `Telegram Bot API 9.2 <https://core.telegram.org/bots/api>`_ and gets fast updates to the latest versions of the Bot API
- Supports `Telegram Bot API 9.3 <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
- Updates router (Blueprints)
- Has Finite State Machine

View file

@ -1,2 +1,2 @@
__version__ = "3.23.0"
__api_version__ = "9.2"
__version__ = "3.24.0"
__api_version__ = "9.3"

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,6 @@
from typing import TYPE_CHECKING, Any, Optional
from __future__ import annotations
from typing import TYPE_CHECKING, Any
from pydantic import BaseModel, PrivateAttr
from typing_extensions import Self
@ -8,12 +10,12 @@ if TYPE_CHECKING:
class BotContextController(BaseModel):
_bot: Optional["Bot"] = PrivateAttr()
_bot: Bot | None = PrivateAttr()
def model_post_init(self, __context: Any) -> None: # noqa: PYI063
self._bot = __context.get("bot") if __context else None
def as_(self, bot: Optional["Bot"]) -> Self:
def as_(self, bot: Bot | None) -> Self:
"""
Bind object to a bot instance.
@ -24,7 +26,7 @@ class BotContextController(BaseModel):
return self
@property
def bot(self) -> Optional["Bot"]:
def bot(self) -> Bot | None:
"""
Get bot instance.

View file

@ -679,6 +679,6 @@ class Dispatcher(Router):
if sys.version_info >= (3, 11):
with asyncio.Runner(loop_factory=uvloop.new_event_loop) as runner:
return runner.run(coro)
else:
else: # pragma: no cover
uvloop.install()
return asyncio.run(coro)

View file

@ -1,5 +1,6 @@
import asyncio
import inspect
import sys
import warnings
from collections.abc import Callable
from dataclasses import dataclass, field
@ -16,6 +17,12 @@ from aiogram.utils.warnings import Recommendation
CallbackType = Callable[..., Any]
_ACCEPTED_PARAM_KINDS = {
inspect.Parameter.POSITIONAL_ONLY,
inspect.Parameter.POSITIONAL_OR_KEYWORD,
inspect.Parameter.KEYWORD_ONLY,
}
@dataclass
class CallableObject:
@ -27,9 +34,30 @@ class CallableObject:
def __post_init__(self) -> None:
callback = inspect.unwrap(self.callback)
self.awaitable = inspect.isawaitable(callback) or inspect.iscoroutinefunction(callback)
spec = inspect.getfullargspec(callback)
self.params = {*spec.args, *spec.kwonlyargs}
self.varkw = spec.varkw is not None
kwargs: dict[str, Any] = {}
if sys.version_info >= (3, 14):
import annotationlib
kwargs["annotation_format"] = annotationlib.Format.FORWARDREF
try:
signature = inspect.signature(callback, **kwargs)
except (ValueError, TypeError): # pragma: no cover
self.params = set()
self.varkw = False
return
params: set[str] = set()
varkw: bool = False
for p in signature.parameters.values():
if p.kind in _ACCEPTED_PARAM_KINDS:
params.add(p.name)
elif p.kind == inspect.Parameter.VAR_KEYWORD:
varkw = True
self.params = params
self.varkw = varkw
def _prepare_kwargs(self, kwargs: dict[str, Any]) -> dict[str, Any]:
if self.varkw:

View file

@ -1,6 +1,8 @@
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, Union, cast, overload
from typing import TYPE_CHECKING, Any, cast, overload
from magic_filter import AttrDict, MagicFilter
@ -42,7 +44,7 @@ class FlagDecorator:
self,
value: Any | None = None,
**kwargs: Any,
) -> Union[Callable[..., Any], "FlagDecorator"]:
) -> Callable[..., Any] | FlagDecorator:
if value and kwargs:
msg = "The arguments `value` and **kwargs can not be used together"
raise ValueError(msg)
@ -86,7 +88,7 @@ def extract_flags_from_object(obj: Any) -> dict[str, Any]:
return cast(dict[str, Any], obj.aiogram_flag)
def extract_flags(handler: Union["HandlerObject", dict[str, Any]]) -> dict[str, Any]:
def extract_flags(handler: HandlerObject | dict[str, Any]) -> dict[str, Any]:
"""
Extract flags from handler or middleware context data
@ -101,7 +103,7 @@ def extract_flags(handler: Union["HandlerObject", dict[str, Any]]) -> dict[str,
def get_flag(
handler: Union["HandlerObject", dict[str, Any]],
handler: HandlerObject | dict[str, Any],
name: str,
*,
default: Any | None = None,
@ -118,7 +120,7 @@ def get_flag(
return flags.get(name, default)
def check_flags(handler: Union["HandlerObject", dict[str, Any]], magic: MagicFilter) -> Any:
def check_flags(handler: HandlerObject | dict[str, Any], magic: MagicFilter) -> Any:
"""
Check flags via magic filter

View file

@ -45,6 +45,7 @@ class ContentType(str, Enum):
CHAT_SHARED = "chat_shared"
GIFT = "gift"
UNIQUE_GIFT = "unique_gift"
GIFT_UPGRADE_SENT = "gift_upgrade_sent"
CONNECTED_WEBSITE = "connected_website"
WRITE_ACCESS_ALLOWED = "write_access_allowed"
PASSPORT_DATA = "passport_data"

View file

@ -1,4 +1,4 @@
from typing import Any, Optional
from typing import Any
from aiogram.methods import TelegramMethod
from aiogram.methods.base import TelegramType

View file

@ -27,7 +27,7 @@ class Filter(ABC): # noqa: B024
Accepts incoming event and should return boolean or dict.
:return: :class:`bool` or :class:`Dict[str, Any]`
:return: :class:`bool` or :class:`dict[str, Any]`
"""
def __invert__(self) -> "_InvertFilter":

View file

@ -1,4 +1,6 @@
from typing import Any, TypeVar, Union
from __future__ import annotations
from typing import Any, TypeVar
from typing_extensions import Self
@ -34,7 +36,7 @@ class _MemberStatusMarker:
def __or__(
self,
other: Union["_MemberStatusMarker", "_MemberStatusGroupMarker"],
other: _MemberStatusMarker | _MemberStatusGroupMarker,
) -> "_MemberStatusGroupMarker":
if isinstance(other, _MemberStatusMarker):
return _MemberStatusGroupMarker(self, other)
@ -50,7 +52,7 @@ class _MemberStatusMarker:
def __rshift__(
self,
other: Union["_MemberStatusMarker", "_MemberStatusGroupMarker"],
other: _MemberStatusMarker | _MemberStatusGroupMarker,
) -> "_MemberStatusTransition":
old = _MemberStatusGroupMarker(self)
if isinstance(other, _MemberStatusMarker):
@ -65,7 +67,7 @@ class _MemberStatusMarker:
def __lshift__(
self,
other: Union["_MemberStatusMarker", "_MemberStatusGroupMarker"],
other: _MemberStatusMarker | _MemberStatusGroupMarker,
) -> "_MemberStatusTransition":
new = _MemberStatusGroupMarker(self)
if isinstance(other, _MemberStatusMarker):
@ -101,7 +103,7 @@ class _MemberStatusGroupMarker:
def __or__(
self,
other: Union["_MemberStatusMarker", "_MemberStatusGroupMarker"],
other: _MemberStatusMarker | _MemberStatusGroupMarker,
) -> Self:
if isinstance(other, _MemberStatusMarker):
return type(self)(*self.statuses, other)
@ -115,7 +117,7 @@ class _MemberStatusGroupMarker:
def __rshift__(
self,
other: Union["_MemberStatusMarker", "_MemberStatusGroupMarker"],
other: _MemberStatusMarker | _MemberStatusGroupMarker,
) -> "_MemberStatusTransition":
if isinstance(other, _MemberStatusMarker):
return _MemberStatusTransition(old=self, new=_MemberStatusGroupMarker(other))
@ -129,7 +131,7 @@ class _MemberStatusGroupMarker:
def __lshift__(
self,
other: Union["_MemberStatusMarker", "_MemberStatusGroupMarker"],
other: _MemberStatusMarker | _MemberStatusGroupMarker,
) -> "_MemberStatusTransition":
if isinstance(other, _MemberStatusMarker):
return _MemberStatusTransition(old=_MemberStatusGroupMarker(other), new=self)

View file

@ -65,8 +65,7 @@ class Command(Filter):
if not isinstance(commands, Iterable):
msg = (
"Command filter only supports str, re.Pattern, BotCommand object"
" or their Iterable"
"Command filter only supports str, re.Pattern, BotCommand object or their Iterable"
)
raise ValueError(msg)

View file

@ -1,5 +1,4 @@
from abc import ABC
from typing import Optional
from aiogram.handlers import BaseHandler
from aiogram.types import CallbackQuery, MaybeInaccessibleMessage, User

View file

@ -1,5 +1,5 @@
from abc import ABC
from typing import Optional, cast
from typing import cast
from aiogram.filters import CommandObject
from aiogram.handlers.base import BaseHandler, BaseHandlerMixin

View file

@ -54,6 +54,7 @@ from .get_business_account_star_balance import GetBusinessAccountStarBalance
from .get_business_connection import GetBusinessConnection
from .get_chat import GetChat
from .get_chat_administrators import GetChatAdministrators
from .get_chat_gifts import GetChatGifts
from .get_chat_member import GetChatMember
from .get_chat_member_count import GetChatMemberCount
from .get_chat_menu_button import GetChatMenuButton
@ -72,6 +73,7 @@ from .get_star_transactions import GetStarTransactions
from .get_sticker_set import GetStickerSet
from .get_updates import GetUpdates
from .get_user_chat_boosts import GetUserChatBoosts
from .get_user_gifts import GetUserGifts
from .get_user_profile_photos import GetUserProfilePhotos
from .get_webhook_info import GetWebhookInfo
from .gift_premium_subscription import GiftPremiumSubscription
@ -89,6 +91,7 @@ from .remove_user_verification import RemoveUserVerification
from .reopen_forum_topic import ReopenForumTopic
from .reopen_general_forum_topic import ReopenGeneralForumTopic
from .replace_sticker_in_set import ReplaceStickerInSet
from .repost_story import RepostStory
from .restrict_chat_member import RestrictChatMember
from .revoke_chat_invite_link import RevokeChatInviteLink
from .save_prepared_inline_message import SavePreparedInlineMessage
@ -105,6 +108,7 @@ from .send_invoice import SendInvoice
from .send_location import SendLocation
from .send_media_group import SendMediaGroup
from .send_message import SendMessage
from .send_message_draft import SendMessageDraft
from .send_paid_media import SendPaidMedia
from .send_photo import SendPhoto
from .send_poll import SendPoll
@ -214,6 +218,7 @@ __all__ = (
"GetBusinessConnection",
"GetChat",
"GetChatAdministrators",
"GetChatGifts",
"GetChatMember",
"GetChatMemberCount",
"GetChatMenuButton",
@ -232,6 +237,7 @@ __all__ = (
"GetStickerSet",
"GetUpdates",
"GetUserChatBoosts",
"GetUserGifts",
"GetUserProfilePhotos",
"GetWebhookInfo",
"GiftPremiumSubscription",
@ -249,6 +255,7 @@ __all__ = (
"ReopenForumTopic",
"ReopenGeneralForumTopic",
"ReplaceStickerInSet",
"RepostStory",
"Request",
"Response",
"RestrictChatMember",
@ -267,6 +274,7 @@ __all__ = (
"SendLocation",
"SendMediaGroup",
"SendMessage",
"SendMessageDraft",
"SendPaidMedia",
"SendPhoto",
"SendPoll",

View file

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional
from typing import TYPE_CHECKING, Any
from .base import TelegramMethod
@ -19,13 +19,13 @@ class AnswerCallbackQuery(TelegramMethod[bool]):
callback_query_id: str
"""Unique identifier for the query to be answered"""
text: Optional[str] = None
text: str | None = None
"""Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters"""
show_alert: Optional[bool] = None
show_alert: bool | None = None
"""If :code:`True`, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to *false*."""
url: Optional[str] = None
url: str | None = None
"""URL that will be opened by the user's client. If you have created a :class:`aiogram.types.game.Game` and accepted the conditions via `@BotFather <https://t.me/botfather>`_, specify the URL that opens your game - note that this will only work if the query comes from a `https://core.telegram.org/bots/api#inlinekeyboardbutton <https://core.telegram.org/bots/api#inlinekeyboardbutton>`_ *callback_game* button."""
cache_time: Optional[int] = None
cache_time: int | None = None
"""The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0."""
if TYPE_CHECKING:
@ -36,10 +36,10 @@ class AnswerCallbackQuery(TelegramMethod[bool]):
__pydantic__self__,
*,
callback_query_id: str,
text: Optional[str] = None,
show_alert: Optional[bool] = None,
url: Optional[str] = None,
cache_time: Optional[int] = None,
text: str | None = None,
show_alert: bool | None = None,
url: str | None = None,
cache_time: int | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!

View file

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional
from typing import TYPE_CHECKING, Any
from pydantic import Field
@ -24,20 +24,20 @@ class AnswerInlineQuery(TelegramMethod[bool]):
"""Unique identifier for the answered query"""
results: list[InlineQueryResultUnion]
"""A JSON-serialized array of results for the inline query"""
cache_time: Optional[int] = None
cache_time: int | None = None
"""The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300."""
is_personal: Optional[bool] = None
is_personal: bool | None = None
"""Pass :code:`True` if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query."""
next_offset: Optional[str] = None
next_offset: str | None = None
"""Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don't support pagination. Offset length can't exceed 64 bytes."""
button: Optional[InlineQueryResultsButton] = None
button: InlineQueryResultsButton | None = None
"""A JSON-serialized object describing a button to be shown above inline query results"""
switch_pm_parameter: Optional[str] = Field(None, json_schema_extra={"deprecated": True})
switch_pm_parameter: str | None = Field(None, json_schema_extra={"deprecated": True})
"""`Deep-linking <https://core.telegram.org/bots/features#deep-linking>`_ parameter for the /start message sent to the bot when user presses the switch button. 1-64 characters, only :code:`A-Z`, :code:`a-z`, :code:`0-9`, :code:`_` and :code:`-` are allowed.
.. deprecated:: API:6.7
https://core.telegram.org/bots/api-changelog#april-21-2023"""
switch_pm_text: Optional[str] = Field(None, json_schema_extra={"deprecated": True})
switch_pm_text: str | None = Field(None, json_schema_extra={"deprecated": True})
"""If passed, clients will display a button with specified text that switches the user to a private chat with the bot and sends the bot a start message with the parameter *switch_pm_parameter*
.. deprecated:: API:6.7
@ -52,12 +52,12 @@ class AnswerInlineQuery(TelegramMethod[bool]):
*,
inline_query_id: str,
results: list[InlineQueryResultUnion],
cache_time: Optional[int] = None,
is_personal: Optional[bool] = None,
next_offset: Optional[str] = None,
button: Optional[InlineQueryResultsButton] = None,
switch_pm_parameter: Optional[str] = None,
switch_pm_text: Optional[str] = None,
cache_time: int | None = None,
is_personal: bool | None = None,
next_offset: str | None = None,
button: InlineQueryResultsButton | None = None,
switch_pm_parameter: str | None = None,
switch_pm_text: str | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!

View file

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional
from typing import TYPE_CHECKING, Any
from .base import TelegramMethod
@ -19,7 +19,7 @@ class AnswerPreCheckoutQuery(TelegramMethod[bool]):
"""Unique identifier for the query to be answered"""
ok: bool
"""Specify :code:`True` if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use :code:`False` if there are any problems."""
error_message: Optional[str] = None
error_message: str | None = None
"""Required if *ok* is :code:`False`. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user."""
if TYPE_CHECKING:
@ -31,7 +31,7 @@ class AnswerPreCheckoutQuery(TelegramMethod[bool]):
*,
pre_checkout_query_id: str,
ok: bool,
error_message: Optional[str] = None,
error_message: str | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!

View file

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional
from typing import TYPE_CHECKING, Any
from ..types import ShippingOption
from .base import TelegramMethod
@ -20,9 +20,9 @@ class AnswerShippingQuery(TelegramMethod[bool]):
"""Unique identifier for the query to be answered"""
ok: bool
"""Pass :code:`True` if delivery to the specified address is possible and :code:`False` if there are any problems (for example, if delivery to the specified address is not possible)"""
shipping_options: Optional[list[ShippingOption]] = None
shipping_options: list[ShippingOption] | None = None
"""Required if *ok* is :code:`True`. A JSON-serialized array of available shipping options."""
error_message: Optional[str] = None
error_message: str | None = None
"""Required if *ok* is :code:`False`. Error message in human readable form that explains why it is impossible to complete the order (e.g. 'Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user."""
if TYPE_CHECKING:
@ -34,8 +34,8 @@ class AnswerShippingQuery(TelegramMethod[bool]):
*,
shipping_query_id: str,
ok: bool,
shipping_options: Optional[list[ShippingOption]] = None,
error_message: Optional[str] = None,
shipping_options: list[ShippingOption] | None = None,
error_message: str | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!

View file

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional
from typing import TYPE_CHECKING, Any
from ..types import DateTimeUnion
from .base import TelegramMethod
@ -20,7 +20,7 @@ class ApproveSuggestedPost(TelegramMethod[bool]):
"""Unique identifier for the target direct messages chat"""
message_id: int
"""Identifier of a suggested post message to approve"""
send_date: Optional[DateTimeUnion] = None
send_date: DateTimeUnion | None = None
"""Point in time (Unix timestamp) when the post is expected to be published; omit if the date has already been specified when the suggested post was created. If specified, then the date must be not more than 2678400 seconds (30 days) in the future"""
if TYPE_CHECKING:
@ -32,7 +32,7 @@ class ApproveSuggestedPost(TelegramMethod[bool]):
*,
chat_id: int,
message_id: int,
send_date: Optional[DateTimeUnion] = None,
send_date: DateTimeUnion | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!

View file

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional
from typing import TYPE_CHECKING, Any
from ..types import ChatIdUnion, DateTimeUnion
from .base import TelegramMethod
@ -20,9 +20,9 @@ class BanChatMember(TelegramMethod[bool]):
"""Unique identifier for the target group or username of the target supergroup or channel (in the format :code:`@channelusername`)"""
user_id: int
"""Unique identifier of the target user"""
until_date: Optional[DateTimeUnion] = None
until_date: DateTimeUnion | None = None
"""Date when the user will be unbanned; Unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only."""
revoke_messages: Optional[bool] = None
revoke_messages: bool | None = None
"""Pass :code:`True` to delete all messages from the chat for the user that is being removed. If :code:`False`, the user will be able to see messages in the group that were sent before the user was removed. Always :code:`True` for supergroups and channels."""
if TYPE_CHECKING:
@ -34,8 +34,8 @@ class BanChatMember(TelegramMethod[bool]):
*,
chat_id: ChatIdUnion,
user_id: int,
until_date: Optional[DateTimeUnion] = None,
revoke_messages: Optional[bool] = None,
until_date: DateTimeUnion | None = None,
revoke_messages: bool | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!

View file

@ -5,10 +5,8 @@ from typing import (
TYPE_CHECKING,
Any,
ClassVar,
Dict,
Generator,
Generic,
Optional,
TypeVar,
)
@ -31,16 +29,16 @@ class Request(BaseModel):
method: str
data: Dict[str, Optional[Any]]
files: Optional[Dict[str, InputFile]]
data: dict[str, Any | None]
files: dict[str, InputFile] | None
class Response(BaseModel, Generic[TelegramType]):
ok: bool
result: Optional[TelegramType] = None
description: Optional[str] = None
error_code: Optional[int] = None
parameters: Optional[ResponseParameters] = None
result: TelegramType | None = None
description: str | None = None
error_code: int | None = None
parameters: ResponseParameters | None = None
class TelegramMethod(BotContextController, BaseModel, Generic[TelegramType], ABC):
@ -52,7 +50,7 @@ class TelegramMethod(BotContextController, BaseModel, Generic[TelegramType], ABC
@model_validator(mode="before")
@classmethod
def remove_unset(cls, values: Dict[str, Any]) -> Dict[str, Any]:
def remove_unset(cls, values: dict[str, Any]) -> dict[str, Any]:
"""
Remove UNSET before fields validation.

View file

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional, Union
from typing import TYPE_CHECKING, Any
from pydantic import Field
@ -33,40 +33,40 @@ class CopyMessage(TelegramMethod[MessageId]):
"""Unique identifier for the chat where the original message was sent (or channel username in the format :code:`@channelusername`)"""
message_id: int
"""Message identifier in the chat specified in *from_chat_id*"""
message_thread_id: Optional[int] = None
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
direct_messages_topic_id: Optional[int] = None
message_thread_id: int | None = None
"""Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only"""
direct_messages_topic_id: int | None = None
"""Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat"""
video_start_timestamp: Optional[DateTimeUnion] = None
video_start_timestamp: DateTimeUnion | None = None
"""New start timestamp for the copied video in the message"""
caption: Optional[str] = None
caption: str | None = None
"""New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept"""
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
parse_mode: str | Default | None = Default("parse_mode")
"""Mode for parsing entities in the new caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
caption_entities: Optional[list[MessageEntity]] = None
caption_entities: list[MessageEntity] | None = None
"""A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of *parse_mode*"""
show_caption_above_media: Optional[Union[bool, Default]] = Default("show_caption_above_media")
show_caption_above_media: bool | Default | None = Default("show_caption_above_media")
"""Pass :code:`True`, if the caption must be shown above the message media. Ignored if a new caption isn't specified."""
disable_notification: Optional[bool] = None
disable_notification: bool | None = None
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
protect_content: bool | Default | None = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
allow_paid_broadcast: Optional[bool] = None
allow_paid_broadcast: bool | None = None
"""Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits <https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance"""
suggested_post_parameters: Optional[SuggestedPostParameters] = None
message_effect_id: str | None = None
"""Unique identifier of the message effect to be added to the message; only available when copying to private chats"""
suggested_post_parameters: SuggestedPostParameters | None = None
"""A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined."""
reply_parameters: Optional[ReplyParameters] = None
reply_parameters: ReplyParameters | None = None
"""Description of the message to reply to"""
reply_markup: Optional[ReplyMarkupUnion] = None
reply_markup: ReplyMarkupUnion | None = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user"""
allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True}
)
allow_sending_without_reply: bool | None = Field(None, json_schema_extra={"deprecated": True})
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
.. deprecated:: API:7.0
https://core.telegram.org/bots/api-changelog#december-29-2023"""
reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True})
reply_to_message_id: int | None = Field(None, json_schema_extra={"deprecated": True})
"""If the message is a reply, ID of the original message
.. deprecated:: API:7.0
@ -82,23 +82,22 @@ class CopyMessage(TelegramMethod[MessageId]):
chat_id: ChatIdUnion,
from_chat_id: ChatIdUnion,
message_id: int,
message_thread_id: Optional[int] = None,
direct_messages_topic_id: Optional[int] = None,
video_start_timestamp: Optional[DateTimeUnion] = None,
caption: Optional[str] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
caption_entities: Optional[list[MessageEntity]] = None,
show_caption_above_media: Optional[Union[bool, Default]] = Default(
"show_caption_above_media"
),
disable_notification: Optional[bool] = None,
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
allow_paid_broadcast: Optional[bool] = None,
suggested_post_parameters: Optional[SuggestedPostParameters] = None,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[ReplyMarkupUnion] = None,
allow_sending_without_reply: Optional[bool] = None,
reply_to_message_id: Optional[int] = None,
message_thread_id: int | None = None,
direct_messages_topic_id: int | None = None,
video_start_timestamp: DateTimeUnion | None = None,
caption: str | None = None,
parse_mode: str | Default | None = Default("parse_mode"),
caption_entities: list[MessageEntity] | None = None,
show_caption_above_media: bool | Default | None = Default("show_caption_above_media"),
disable_notification: bool | None = None,
protect_content: bool | Default | None = Default("protect_content"),
allow_paid_broadcast: bool | None = None,
message_effect_id: str | None = None,
suggested_post_parameters: SuggestedPostParameters | None = None,
reply_parameters: ReplyParameters | None = None,
reply_markup: ReplyMarkupUnion | None = None,
allow_sending_without_reply: bool | None = None,
reply_to_message_id: int | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
@ -119,6 +118,7 @@ class CopyMessage(TelegramMethod[MessageId]):
disable_notification=disable_notification,
protect_content=protect_content,
allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
suggested_post_parameters=suggested_post_parameters,
reply_parameters=reply_parameters,
reply_markup=reply_markup,

View file

@ -1,4 +1,4 @@
from typing import TYPE_CHECKING, Any, Optional
from typing import TYPE_CHECKING, Any
from ..types import ChatIdUnion, MessageId
from .base import TelegramMethod
@ -20,15 +20,15 @@ class CopyMessages(TelegramMethod[list[MessageId]]):
"""Unique identifier for the chat where the original messages were sent (or channel username in the format :code:`@channelusername`)"""
message_ids: list[int]
"""A JSON-serialized list of 1-100 identifiers of messages in the chat *from_chat_id* to copy. The identifiers must be specified in a strictly increasing order."""
message_thread_id: Optional[int] = None
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
direct_messages_topic_id: Optional[int] = None
message_thread_id: int | None = None
"""Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only"""
direct_messages_topic_id: int | None = None
"""Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat"""
disable_notification: Optional[bool] = None
disable_notification: bool | None = None
"""Sends the messages `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
protect_content: Optional[bool] = None
protect_content: bool | None = None
"""Protects the contents of the sent messages from forwarding and saving"""
remove_caption: Optional[bool] = None
remove_caption: bool | None = None
"""Pass :code:`True` to copy the messages without their captions"""
if TYPE_CHECKING:
@ -41,11 +41,11 @@ class CopyMessages(TelegramMethod[list[MessageId]]):
chat_id: ChatIdUnion,
from_chat_id: ChatIdUnion,
message_ids: list[int],
message_thread_id: Optional[int] = None,
direct_messages_topic_id: Optional[int] = None,
disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = None,
remove_caption: Optional[bool] = None,
message_thread_id: int | None = None,
direct_messages_topic_id: int | None = None,
disable_notification: bool | None = None,
protect_content: bool | None = None,
remove_caption: bool | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!

View file

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional
from typing import TYPE_CHECKING, Any
from ..types import ChatIdUnion, ChatInviteLink, DateTimeUnion
from .base import TelegramMethod
@ -18,13 +18,13 @@ class CreateChatInviteLink(TelegramMethod[ChatInviteLink]):
chat_id: ChatIdUnion
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
name: Optional[str] = None
name: str | None = None
"""Invite link name; 0-32 characters"""
expire_date: Optional[DateTimeUnion] = None
expire_date: DateTimeUnion | None = None
"""Point in time (Unix timestamp) when the link will expire"""
member_limit: Optional[int] = None
member_limit: int | None = None
"""The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999"""
creates_join_request: Optional[bool] = None
creates_join_request: bool | None = None
""":code:`True`, if users joining the chat via the link need to be approved by chat administrators. If :code:`True`, *member_limit* can't be specified"""
if TYPE_CHECKING:
@ -35,10 +35,10 @@ class CreateChatInviteLink(TelegramMethod[ChatInviteLink]):
__pydantic__self__,
*,
chat_id: ChatIdUnion,
name: Optional[str] = None,
expire_date: Optional[DateTimeUnion] = None,
member_limit: Optional[int] = None,
creates_join_request: Optional[bool] = None,
name: str | None = None,
expire_date: DateTimeUnion | None = None,
member_limit: int | None = None,
creates_join_request: bool | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!

View file

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional
from typing import TYPE_CHECKING, Any
from ..types import ChatIdUnion, ChatInviteLink, DateTimeUnion
from .base import TelegramMethod
@ -22,7 +22,7 @@ class CreateChatSubscriptionInviteLink(TelegramMethod[ChatInviteLink]):
"""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
"""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: str | None = None
"""Invite link name; 0-32 characters"""
if TYPE_CHECKING:
@ -35,7 +35,7 @@ class CreateChatSubscriptionInviteLink(TelegramMethod[ChatInviteLink]):
chat_id: ChatIdUnion,
subscription_period: DateTimeUnion,
subscription_price: int,
name: Optional[str] = None,
name: str | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!

View file

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional
from typing import TYPE_CHECKING, Any
from ..types import ChatIdUnion, ForumTopic
from .base import TelegramMethod
@ -20,9 +20,9 @@ class CreateForumTopic(TelegramMethod[ForumTopic]):
"""Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)"""
name: str
"""Topic name, 1-128 characters"""
icon_color: Optional[int] = None
icon_color: int | None = None
"""Color of the topic icon in RGB format. Currently, must be one of 7322096 (0x6FB9F0), 16766590 (0xFFD67E), 13338331 (0xCB86DB), 9367192 (0x8EEE98), 16749490 (0xFF93B2), or 16478047 (0xFB6F5F)"""
icon_custom_emoji_id: Optional[str] = None
icon_custom_emoji_id: str | None = None
"""Unique identifier of the custom emoji shown as the topic icon. Use :class:`aiogram.methods.get_forum_topic_icon_stickers.GetForumTopicIconStickers` to get all allowed custom emoji identifiers."""
if TYPE_CHECKING:
@ -34,8 +34,8 @@ class CreateForumTopic(TelegramMethod[ForumTopic]):
*,
chat_id: ChatIdUnion,
name: str,
icon_color: Optional[int] = None,
icon_custom_emoji_id: Optional[str] = None,
icon_color: int | None = None,
icon_custom_emoji_id: str | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!

View file

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional
from typing import TYPE_CHECKING, Any
from ..types import LabeledPrice
from .base import TelegramMethod
@ -26,39 +26,39 @@ class CreateInvoiceLink(TelegramMethod[str]):
"""Three-letter ISO 4217 currency code, see `more on currencies <https://core.telegram.org/bots/payments#supported-currencies>`_. Pass 'XTR' for payments in `Telegram Stars <https://t.me/BotNews/90>`_."""
prices: list[LabeledPrice]
"""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>`_."""
business_connection_id: Optional[str] = None
business_connection_id: str | None = None
"""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."""
provider_token: Optional[str] = None
provider_token: str | None = 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>`_."""
subscription_period: Optional[int] = None
subscription_period: int | None = 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 10000 Telegram Stars."""
max_tip_amount: Optional[int] = None
max_tip_amount: int | None = 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>`_."""
suggested_tip_amounts: Optional[list[int]] = None
suggested_tip_amounts: list[int] | None = None
"""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*."""
provider_data: Optional[str] = None
provider_data: str | None = None
"""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."""
photo_url: Optional[str] = None
photo_url: str | None = None
"""URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service."""
photo_size: Optional[int] = None
photo_size: int | None = None
"""Photo size in bytes"""
photo_width: Optional[int] = None
photo_width: int | None = None
"""Photo width"""
photo_height: Optional[int] = None
photo_height: int | None = None
"""Photo height"""
need_name: Optional[bool] = None
need_name: bool | None = None
"""Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars <https://t.me/BotNews/90>`_."""
need_phone_number: Optional[bool] = None
need_phone_number: bool | None = None
"""Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars <https://t.me/BotNews/90>`_."""
need_email: Optional[bool] = None
need_email: bool | None = None
"""Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars <https://t.me/BotNews/90>`_."""
need_shipping_address: Optional[bool] = None
need_shipping_address: bool | None = None
"""Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars <https://t.me/BotNews/90>`_."""
send_phone_number_to_provider: Optional[bool] = None
send_phone_number_to_provider: bool | None = None
"""Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars <https://t.me/BotNews/90>`_."""
send_email_to_provider: Optional[bool] = None
send_email_to_provider: bool | None = None
"""Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars <https://t.me/BotNews/90>`_."""
is_flexible: Optional[bool] = None
is_flexible: bool | None = None
"""Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars <https://t.me/BotNews/90>`_."""
if TYPE_CHECKING:
@ -73,23 +73,23 @@ class CreateInvoiceLink(TelegramMethod[str]):
payload: str,
currency: str,
prices: list[LabeledPrice],
business_connection_id: Optional[str] = None,
provider_token: Optional[str] = None,
subscription_period: Optional[int] = None,
max_tip_amount: Optional[int] = None,
suggested_tip_amounts: Optional[list[int]] = None,
provider_data: Optional[str] = None,
photo_url: Optional[str] = None,
photo_size: Optional[int] = None,
photo_width: Optional[int] = None,
photo_height: Optional[int] = None,
need_name: Optional[bool] = None,
need_phone_number: Optional[bool] = None,
need_email: Optional[bool] = None,
need_shipping_address: Optional[bool] = None,
send_phone_number_to_provider: Optional[bool] = None,
send_email_to_provider: Optional[bool] = None,
is_flexible: Optional[bool] = None,
business_connection_id: str | None = None,
provider_token: str | None = None,
subscription_period: int | None = None,
max_tip_amount: int | None = None,
suggested_tip_amounts: list[int] | None = None,
provider_data: str | None = None,
photo_url: str | None = None,
photo_size: int | None = None,
photo_width: int | None = None,
photo_height: int | None = None,
need_name: bool | None = None,
need_phone_number: bool | None = None,
need_email: bool | None = None,
need_shipping_address: bool | None = None,
send_phone_number_to_provider: bool | None = None,
send_email_to_provider: bool | None = None,
is_flexible: bool | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!

View file

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional
from typing import TYPE_CHECKING, Any
from pydantic import Field
@ -26,11 +26,11 @@ class CreateNewStickerSet(TelegramMethod[bool]):
"""Sticker set title, 1-64 characters"""
stickers: list[InputSticker]
"""A JSON-serialized list of 1-50 initial stickers to be added to the sticker set"""
sticker_type: Optional[str] = None
sticker_type: str | None = None
"""Type of stickers in the set, pass 'regular', 'mask', or 'custom_emoji'. By default, a regular sticker set is created."""
needs_repainting: Optional[bool] = None
needs_repainting: bool | None = None
"""Pass :code:`True` if stickers in the sticker set must be repainted to the color of text when used in messages, the accent color if used as emoji status, white on chat photos, or another appropriate color based on context; for custom emoji sticker sets only"""
sticker_format: Optional[str] = Field(None, json_schema_extra={"deprecated": True})
sticker_format: str | None = Field(None, json_schema_extra={"deprecated": True})
"""Format of stickers in the set, must be one of 'static', 'animated', 'video'
.. deprecated:: API:7.2
@ -47,9 +47,9 @@ class CreateNewStickerSet(TelegramMethod[bool]):
name: str,
title: str,
stickers: list[InputSticker],
sticker_type: Optional[str] = None,
needs_repainting: Optional[bool] = None,
sticker_format: Optional[str] = None,
sticker_type: str | None = None,
needs_repainting: bool | None = None,
sticker_format: str | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!

View file

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional
from typing import TYPE_CHECKING, Any
from .base import TelegramMethod
@ -19,7 +19,7 @@ class DeclineSuggestedPost(TelegramMethod[bool]):
"""Unique identifier for the target direct messages chat"""
message_id: int
"""Identifier of a suggested post message to decline"""
comment: Optional[str] = None
comment: str | None = None
"""Comment for the creator of the suggested post; 0-128 characters"""
if TYPE_CHECKING:
@ -31,7 +31,7 @@ class DeclineSuggestedPost(TelegramMethod[bool]):
*,
chat_id: int,
message_id: int,
comment: Optional[str] = None,
comment: str | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!

View file

@ -8,7 +8,7 @@ from .base import TelegramMethod
class DeleteForumTopic(TelegramMethod[bool]):
"""
Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_delete_messages* administrator rights. Returns :code:`True` on success.
Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the *can_delete_messages* administrator rights. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#deleteforumtopic
"""

View file

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional
from typing import TYPE_CHECKING, Any
from ..types import BotCommandScopeUnion
from .base import TelegramMethod
@ -16,9 +16,9 @@ class DeleteMyCommands(TelegramMethod[bool]):
__returning__ = bool
__api_method__ = "deleteMyCommands"
scope: Optional[BotCommandScopeUnion] = None
scope: BotCommandScopeUnion | None = None
"""A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to :class:`aiogram.types.bot_command_scope_default.BotCommandScopeDefault`."""
language_code: Optional[str] = None
language_code: str | None = None
"""A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands"""
if TYPE_CHECKING:
@ -28,8 +28,8 @@ class DeleteMyCommands(TelegramMethod[bool]):
def __init__(
__pydantic__self__,
*,
scope: Optional[BotCommandScopeUnion] = None,
language_code: Optional[str] = None,
scope: BotCommandScopeUnion | None = None,
language_code: str | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!

View file

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional
from typing import TYPE_CHECKING, Any
from .base import TelegramMethod
@ -15,7 +15,7 @@ class DeleteWebhook(TelegramMethod[bool]):
__returning__ = bool
__api_method__ = "deleteWebhook"
drop_pending_updates: Optional[bool] = None
drop_pending_updates: bool | None = None
"""Pass :code:`True` to drop all pending updates"""
if TYPE_CHECKING:
@ -25,7 +25,7 @@ class DeleteWebhook(TelegramMethod[bool]):
def __init__(
__pydantic__self__,
*,
drop_pending_updates: Optional[bool] = None,
drop_pending_updates: bool | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!

View file

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional
from typing import TYPE_CHECKING, Any
from ..types import ChatIdUnion, ChatInviteLink, DateTimeUnion
from .base import TelegramMethod
@ -20,13 +20,13 @@ class EditChatInviteLink(TelegramMethod[ChatInviteLink]):
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
invite_link: str
"""The invite link to edit"""
name: Optional[str] = None
name: str | None = None
"""Invite link name; 0-32 characters"""
expire_date: Optional[DateTimeUnion] = None
expire_date: DateTimeUnion | None = None
"""Point in time (Unix timestamp) when the link will expire"""
member_limit: Optional[int] = None
member_limit: int | None = None
"""The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999"""
creates_join_request: Optional[bool] = None
creates_join_request: bool | None = None
""":code:`True`, if users joining the chat via the link need to be approved by chat administrators. If :code:`True`, *member_limit* can't be specified"""
if TYPE_CHECKING:
@ -38,10 +38,10 @@ class EditChatInviteLink(TelegramMethod[ChatInviteLink]):
*,
chat_id: ChatIdUnion,
invite_link: str,
name: Optional[str] = None,
expire_date: Optional[DateTimeUnion] = None,
member_limit: Optional[int] = None,
creates_join_request: Optional[bool] = None,
name: str | None = None,
expire_date: DateTimeUnion | None = None,
member_limit: int | None = None,
creates_join_request: bool | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!

View file

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional
from typing import TYPE_CHECKING, Any
from ..types import ChatIdUnion, ChatInviteLink
from .base import TelegramMethod
@ -20,7 +20,7 @@ class EditChatSubscriptionInviteLink(TelegramMethod[ChatInviteLink]):
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
invite_link: str
"""The invite link to edit"""
name: Optional[str] = None
name: str | None = None
"""Invite link name; 0-32 characters"""
if TYPE_CHECKING:
@ -32,7 +32,7 @@ class EditChatSubscriptionInviteLink(TelegramMethod[ChatInviteLink]):
*,
chat_id: ChatIdUnion,
invite_link: str,
name: Optional[str] = None,
name: str | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!

View file

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional
from typing import TYPE_CHECKING, Any
from ..types import ChatIdUnion
from .base import TelegramMethod
@ -8,7 +8,7 @@ from .base import TelegramMethod
class EditForumTopic(TelegramMethod[bool]):
"""
Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights, unless it is the creator of the topic. Returns :code:`True` on success.
Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights, unless it is the creator of the topic. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#editforumtopic
"""
@ -20,9 +20,9 @@ class EditForumTopic(TelegramMethod[bool]):
"""Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)"""
message_thread_id: int
"""Unique identifier for the target message thread of the forum topic"""
name: Optional[str] = None
name: str | None = None
"""New topic name, 0-128 characters. If not specified or empty, the current name of the topic will be kept"""
icon_custom_emoji_id: Optional[str] = None
icon_custom_emoji_id: str | None = None
"""New unique identifier of the custom emoji shown as the topic icon. Use :class:`aiogram.methods.get_forum_topic_icon_stickers.GetForumTopicIconStickers` to get all allowed custom emoji identifiers. Pass an empty string to remove the icon. If not specified, the current icon will be kept"""
if TYPE_CHECKING:
@ -34,8 +34,8 @@ class EditForumTopic(TelegramMethod[bool]):
*,
chat_id: ChatIdUnion,
message_thread_id: int,
name: Optional[str] = None,
icon_custom_emoji_id: Optional[str] = None,
name: str | None = None,
icon_custom_emoji_id: str | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!

View file

@ -1,39 +1,39 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional, Union
from typing import TYPE_CHECKING, Any
from ..client.default import Default
from ..types import ChatIdUnion, InlineKeyboardMarkup, Message, MessageEntity
from .base import TelegramMethod
class EditMessageCaption(TelegramMethod[Union[Message, bool]]):
class EditMessageCaption(TelegramMethod[Message | bool]):
"""
Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent.
Source: https://core.telegram.org/bots/api#editmessagecaption
"""
__returning__ = Union[Message, bool]
__returning__ = Message | bool
__api_method__ = "editMessageCaption"
business_connection_id: Optional[str] = None
business_connection_id: str | None = None
"""Unique identifier of the business connection on behalf of which the message to be edited was sent"""
chat_id: Optional[ChatIdUnion] = None
chat_id: ChatIdUnion | None = None
"""Required if *inline_message_id* is not specified. Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
message_id: Optional[int] = None
message_id: int | None = None
"""Required if *inline_message_id* is not specified. Identifier of the message to edit"""
inline_message_id: Optional[str] = None
inline_message_id: str | None = None
"""Required if *chat_id* and *message_id* are not specified. Identifier of the inline message"""
caption: Optional[str] = None
caption: str | None = None
"""New caption of the message, 0-1024 characters after entities parsing"""
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
parse_mode: str | Default | None = Default("parse_mode")
"""Mode for parsing entities in the message caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
caption_entities: Optional[list[MessageEntity]] = None
caption_entities: list[MessageEntity] | None = None
"""A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
show_caption_above_media: Optional[Union[bool, Default]] = Default("show_caption_above_media")
show_caption_above_media: bool | Default | None = Default("show_caption_above_media")
"""Pass :code:`True`, if the caption must be shown above the message media. Supported only for animation, photo and video messages."""
reply_markup: Optional[InlineKeyboardMarkup] = None
reply_markup: InlineKeyboardMarkup | None = None
"""A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_."""
if TYPE_CHECKING:
@ -43,17 +43,15 @@ class EditMessageCaption(TelegramMethod[Union[Message, bool]]):
def __init__(
__pydantic__self__,
*,
business_connection_id: Optional[str] = None,
chat_id: Optional[ChatIdUnion] = None,
message_id: Optional[int] = None,
inline_message_id: Optional[str] = None,
caption: Optional[str] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
caption_entities: Optional[list[MessageEntity]] = None,
show_caption_above_media: Optional[Union[bool, Default]] = Default(
"show_caption_above_media"
),
reply_markup: Optional[InlineKeyboardMarkup] = None,
business_connection_id: str | None = None,
chat_id: ChatIdUnion | None = None,
message_id: int | None = None,
inline_message_id: str | None = None,
caption: str | None = None,
parse_mode: str | Default | None = Default("parse_mode"),
caption_entities: list[MessageEntity] | None = None,
show_caption_above_media: bool | Default | None = Default("show_caption_above_media"),
reply_markup: InlineKeyboardMarkup | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!

View file

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional
from typing import TYPE_CHECKING, Any
from ..types import InlineKeyboardMarkup, InputChecklist, Message
from .base import TelegramMethod
@ -24,7 +24,7 @@ class EditMessageChecklist(TelegramMethod[Message]):
"""Unique identifier for the target message"""
checklist: InputChecklist
"""A JSON-serialized object for the new checklist"""
reply_markup: Optional[InlineKeyboardMarkup] = None
reply_markup: InlineKeyboardMarkup | None = None
"""A JSON-serialized object for the new inline keyboard for the message"""
if TYPE_CHECKING:
@ -38,7 +38,7 @@ class EditMessageChecklist(TelegramMethod[Message]):
chat_id: int,
message_id: int,
checklist: InputChecklist,
reply_markup: Optional[InlineKeyboardMarkup] = None,
reply_markup: InlineKeyboardMarkup | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!

View file

@ -1,42 +1,42 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional, Union
from typing import TYPE_CHECKING, Any
from ..types import ChatIdUnion, InlineKeyboardMarkup, Message
from .base import TelegramMethod
class EditMessageLiveLocation(TelegramMethod[Union[Message, bool]]):
class EditMessageLiveLocation(TelegramMethod[Message | bool]):
"""
Use this method to edit live location messages. A location can be edited until its *live_period* expires or editing is explicitly disabled by a call to :class:`aiogram.methods.stop_message_live_location.StopMessageLiveLocation`. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned.
Source: https://core.telegram.org/bots/api#editmessagelivelocation
"""
__returning__ = Union[Message, bool]
__returning__ = Message | bool
__api_method__ = "editMessageLiveLocation"
latitude: float
"""Latitude of new location"""
longitude: float
"""Longitude of new location"""
business_connection_id: Optional[str] = None
business_connection_id: str | None = None
"""Unique identifier of the business connection on behalf of which the message to be edited was sent"""
chat_id: Optional[ChatIdUnion] = None
chat_id: ChatIdUnion | None = None
"""Required if *inline_message_id* is not specified. Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
message_id: Optional[int] = None
message_id: int | None = None
"""Required if *inline_message_id* is not specified. Identifier of the message to edit"""
inline_message_id: Optional[str] = None
inline_message_id: str | None = None
"""Required if *chat_id* and *message_id* are not specified. Identifier of the inline message"""
live_period: Optional[int] = None
live_period: int | None = None
"""New period in seconds during which the location can be updated, starting from the message send date. If 0x7FFFFFFF is specified, then the location can be updated forever. Otherwise, the new value must not exceed the current *live_period* by more than a day, and the live location expiration date must remain within the next 90 days. If not specified, then *live_period* remains unchanged"""
horizontal_accuracy: Optional[float] = None
horizontal_accuracy: float | None = None
"""The radius of uncertainty for the location, measured in meters; 0-1500"""
heading: Optional[int] = None
heading: int | None = None
"""Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified."""
proximity_alert_radius: Optional[int] = None
proximity_alert_radius: int | None = None
"""The maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified."""
reply_markup: Optional[InlineKeyboardMarkup] = None
reply_markup: InlineKeyboardMarkup | None = None
"""A JSON-serialized object for a new `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_."""
if TYPE_CHECKING:
@ -48,15 +48,15 @@ class EditMessageLiveLocation(TelegramMethod[Union[Message, bool]]):
*,
latitude: float,
longitude: float,
business_connection_id: Optional[str] = None,
chat_id: Optional[ChatIdUnion] = None,
message_id: Optional[int] = None,
inline_message_id: Optional[str] = None,
live_period: Optional[int] = None,
horizontal_accuracy: Optional[float] = None,
heading: Optional[int] = None,
proximity_alert_radius: Optional[int] = None,
reply_markup: Optional[InlineKeyboardMarkup] = None,
business_connection_id: str | None = None,
chat_id: ChatIdUnion | None = None,
message_id: int | None = None,
inline_message_id: str | None = None,
live_period: int | None = None,
horizontal_accuracy: float | None = None,
heading: int | None = None,
proximity_alert_radius: int | None = None,
reply_markup: InlineKeyboardMarkup | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!

View file

@ -1,32 +1,32 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional, Union
from typing import TYPE_CHECKING, Any
from ..types import ChatIdUnion, InlineKeyboardMarkup, InputMediaUnion, Message
from .base import TelegramMethod
class EditMessageMedia(TelegramMethod[Union[Message, bool]]):
class EditMessageMedia(TelegramMethod[Message | bool]):
"""
Use this method to edit animation, audio, document, photo, or video messages, or to add media to text messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent.
Source: https://core.telegram.org/bots/api#editmessagemedia
"""
__returning__ = Union[Message, bool]
__returning__ = Message | bool
__api_method__ = "editMessageMedia"
media: InputMediaUnion
"""A JSON-serialized object for a new media content of the message"""
business_connection_id: Optional[str] = None
business_connection_id: str | None = None
"""Unique identifier of the business connection on behalf of which the message to be edited was sent"""
chat_id: Optional[ChatIdUnion] = None
chat_id: ChatIdUnion | None = None
"""Required if *inline_message_id* is not specified. Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
message_id: Optional[int] = None
message_id: int | None = None
"""Required if *inline_message_id* is not specified. Identifier of the message to edit"""
inline_message_id: Optional[str] = None
inline_message_id: str | None = None
"""Required if *chat_id* and *message_id* are not specified. Identifier of the inline message"""
reply_markup: Optional[InlineKeyboardMarkup] = None
reply_markup: InlineKeyboardMarkup | None = None
"""A JSON-serialized object for a new `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_."""
if TYPE_CHECKING:
@ -37,11 +37,11 @@ class EditMessageMedia(TelegramMethod[Union[Message, bool]]):
__pydantic__self__,
*,
media: InputMediaUnion,
business_connection_id: Optional[str] = None,
chat_id: Optional[ChatIdUnion] = None,
message_id: Optional[int] = None,
inline_message_id: Optional[str] = None,
reply_markup: Optional[InlineKeyboardMarkup] = None,
business_connection_id: str | None = None,
chat_id: ChatIdUnion | None = None,
message_id: int | None = None,
inline_message_id: str | None = None,
reply_markup: InlineKeyboardMarkup | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!

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