mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-06 16:15:51 +00:00
Added full support of Bot API 6.5 (#1112)
* Added full support of Bot API 6.5 * Shut up, linters (Fixed errors) * Oops. Added lost files. * Fixed tests * Added changes description * Update description from docs * Fixed anchors * Update Butcher * Added danger zone to changelog * Type
This commit is contained in:
parent
3428924d63
commit
e59d4652bf
47 changed files with 1218 additions and 184 deletions
|
|
@ -9,9 +9,9 @@
|
|||
"object": {
|
||||
"anchor": "getchatmember",
|
||||
"name": "getChatMember",
|
||||
"description": "Use this method to get information about a member of a chat. The method is guaranteed to work for other users, only if the bot is an administrator in the chat. Returns a ChatMember object on success.",
|
||||
"html_description": "<p>Use this method to get information about a member of a chat. The method is guaranteed to work for other users, only if the bot is an administrator in the chat. Returns a <a href=\"#chatmember\">ChatMember</a> object on success.</p>",
|
||||
"rst_description": "Use this method to get information about a member of a chat. The method is guaranteed to work for other users, only if the bot is an administrator in the chat. Returns a :class:`aiogram.types.chat_member.ChatMember` object on success.",
|
||||
"description": "Use this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat. Returns a ChatMember object on success.",
|
||||
"html_description": "<p>Use this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat. Returns a <a href=\"#chatmember\">ChatMember</a> object on success.</p>",
|
||||
"rst_description": "Use this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat. Returns a :class:`aiogram.types.chat_member.ChatMember` object on success.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "Integer or String",
|
||||
|
|
|
|||
|
|
@ -88,9 +88,9 @@
|
|||
{
|
||||
"type": "Boolean",
|
||||
"required": false,
|
||||
"description": "Pass True if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him)",
|
||||
"html_description": "<td>Pass <em>True</em> if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him)</td>",
|
||||
"rst_description": "Pass :code:`True` if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him)\n",
|
||||
"description": "Pass True if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him)",
|
||||
"html_description": "<td>Pass <em>True</em> if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him)</td>",
|
||||
"rst_description": "Pass :code:`True` if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him)\n",
|
||||
"name": "can_promote_members"
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -37,6 +37,14 @@
|
|||
"rst_description": "A JSON-serialized object for new user permissions\n",
|
||||
"name": "permissions"
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"required": false,
|
||||
"description": "Pass True if chat permissions are set independently. Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission.",
|
||||
"html_description": "<td>Pass <em>True</em> if chat permissions are set independently. Otherwise, the <em>can_send_other_messages</em> and <em>can_add_web_page_previews</em> permissions will imply the <em>can_send_messages</em>, <em>can_send_audios</em>, <em>can_send_documents</em>, <em>can_send_photos</em>, <em>can_send_videos</em>, <em>can_send_video_notes</em>, and <em>can_send_voice_notes</em> permissions; the <em>can_send_polls</em> permission will imply the <em>can_send_messages</em> permission.</td>",
|
||||
"rst_description": "Pass :code:`True` if chat permissions are set independently. Otherwise, the *can_send_other_messages* and *can_add_web_page_previews* permissions will imply the *can_send_messages*, *can_send_audios*, *can_send_documents*, *can_send_photos*, *can_send_videos*, *can_send_video_notes*, and *can_send_voice_notes* permissions; the *can_send_polls* permission will imply the *can_send_messages* permission.\n",
|
||||
"name": "use_independent_chat_permissions"
|
||||
},
|
||||
{
|
||||
"type": "Integer",
|
||||
"required": false,
|
||||
|
|
|
|||
|
|
@ -28,6 +28,14 @@
|
|||
"html_description": "<td>A JSON-serialized object for new default chat permissions</td>",
|
||||
"rst_description": "A JSON-serialized object for new default chat permissions\n",
|
||||
"name": "permissions"
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"required": false,
|
||||
"description": "Pass True if chat permissions are set independently. Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission.",
|
||||
"html_description": "<td>Pass <em>True</em> if chat permissions are set independently. Otherwise, the <em>can_send_other_messages</em> and <em>can_add_web_page_previews</em> permissions will imply the <em>can_send_messages</em>, <em>can_send_audios</em>, <em>can_send_documents</em>, <em>can_send_photos</em>, <em>can_send_videos</em>, <em>can_send_video_notes</em>, and <em>can_send_voice_notes</em> permissions; the <em>can_send_polls</em> permission will imply the <em>can_send_messages</em> permission.</td>",
|
||||
"rst_description": "Pass :code:`True` if chat permissions are set independently. Otherwise, the *can_send_other_messages* and *can_add_web_page_previews* permissions will imply the *can_send_messages*, *can_send_audios*, *can_send_documents*, *can_send_photos*, *can_send_videos*, *can_send_video_notes*, and *can_send_voice_notes* permissions; the *can_send_polls* permission will imply the *can_send_messages* permission.\n",
|
||||
"name": "use_independent_chat_permissions"
|
||||
}
|
||||
],
|
||||
"category": "methods"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"api": {
|
||||
"version": "6.4",
|
||||
"release_date": "2022-12-30"
|
||||
"version": "6.5",
|
||||
"release_date": "2023-02-03"
|
||||
},
|
||||
"items": [
|
||||
{
|
||||
|
|
@ -1125,6 +1125,22 @@
|
|||
"name": "successful_payment",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "UserShared",
|
||||
"description": "Service message: a user was shared with the bot",
|
||||
"html_description": "<td><em>Optional</em>. Service message: a user was shared with the bot</td>",
|
||||
"rst_description": "*Optional*. Service message: a user was shared with the bot\n",
|
||||
"name": "user_shared",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "ChatShared",
|
||||
"description": "Service message: a chat was shared with the bot",
|
||||
"html_description": "<td><em>Optional</em>. Service message: a chat was shared with the bot</td>",
|
||||
"rst_description": "*Optional*. Service message: a chat was shared with the bot\n",
|
||||
"name": "chat_shared",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
"description": "The domain name of the website on which the user has logged in.",
|
||||
|
|
@ -2350,6 +2366,58 @@
|
|||
"annotations": [],
|
||||
"category": "types"
|
||||
},
|
||||
{
|
||||
"anchor": "usershared",
|
||||
"name": "UserShared",
|
||||
"description": "This object contains information about the user whose identifier was shared with the bot using a KeyboardButtonRequestUser button.",
|
||||
"html_description": "<p>This object contains information about the user whose identifier was shared with the bot using a <a href=\"#keyboardbuttonrequestuser\">KeyboardButtonRequestUser</a> button.</p>",
|
||||
"rst_description": "This object contains information about the user whose identifier was shared with the bot using a :class:`aiogram.types.keyboard_button_request_user.KeyboardButtonRequestUser` button.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "Integer",
|
||||
"description": "Identifier of the request",
|
||||
"html_description": "<td>Identifier of the request</td>",
|
||||
"rst_description": "Identifier of the request\n",
|
||||
"name": "request_id",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Integer",
|
||||
"description": "Identifier of the shared user. 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. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means.",
|
||||
"html_description": "<td>Identifier of the shared user. 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. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means.</td>",
|
||||
"rst_description": "Identifier of the shared user. 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. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means.\n",
|
||||
"name": "user_id",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"category": "types"
|
||||
},
|
||||
{
|
||||
"anchor": "chatshared",
|
||||
"name": "ChatShared",
|
||||
"description": "This object contains information about the chat whose identifier was shared with the bot using a KeyboardButtonRequestChat button.",
|
||||
"html_description": "<p>This object contains information about the chat whose identifier was shared with the bot using a <a href=\"#keyboardbuttonrequestchat\">KeyboardButtonRequestChat</a> button.</p>",
|
||||
"rst_description": "This object contains information about the chat whose identifier was shared with the bot using a :class:`aiogram.types.keyboard_button_request_chat.KeyboardButtonRequestChat` button.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "Integer",
|
||||
"description": "Identifier of the request",
|
||||
"html_description": "<td>Identifier of the request</td>",
|
||||
"rst_description": "Identifier of the request\n",
|
||||
"name": "request_id",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Integer",
|
||||
"description": "Identifier of the shared chat. 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. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means.",
|
||||
"html_description": "<td>Identifier of the shared chat. 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. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means.</td>",
|
||||
"rst_description": "Identifier of the shared chat. 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. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means.\n",
|
||||
"name": "chat_id",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"category": "types"
|
||||
},
|
||||
{
|
||||
"anchor": "writeaccessallowed",
|
||||
"name": "WriteAccessAllowed",
|
||||
|
|
@ -2569,9 +2637,9 @@
|
|||
{
|
||||
"anchor": "keyboardbutton",
|
||||
"name": "KeyboardButton",
|
||||
"description": "This object represents one button of the reply keyboard. For simple text buttons String can be used instead of this object to specify text of the button. Optional fields web_app, request_contact, request_location, and request_poll are mutually exclusive.\nNote: request_contact and request_location options will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.\nNote: request_poll option will only work in Telegram versions released after 23 January, 2020. Older clients will display unsupported message.\nNote: web_app option will only work in Telegram versions released after 16 April, 2022. Older clients will display unsupported message.",
|
||||
"html_description": "<p>This object represents one button of the reply keyboard. For simple text buttons <em>String</em> can be used instead of this object to specify text of the button. Optional fields <em>web_app</em>, <em>request_contact</em>, <em>request_location</em>, and <em>request_poll</em> are mutually exclusive.</p><p><strong>Note:</strong> <em>request_contact</em> and <em>request_location</em> options will only work in Telegram versions released after 9 April, 2016. Older clients will display <em>unsupported message</em>.<br/>\n<strong>Note:</strong> <em>request_poll</em> option will only work in Telegram versions released after 23 January, 2020. Older clients will display <em>unsupported message</em>.<br/>\n<strong>Note:</strong> <em>web_app</em> option will only work in Telegram versions released after 16 April, 2022. Older clients will display <em>unsupported message</em>.</p>",
|
||||
"rst_description": "This object represents one button of the reply keyboard. For simple text buttons *String* can be used instead of this object to specify text of the button. Optional fields *web_app*, *request_contact*, *request_location*, and *request_poll* are mutually exclusive.\n**Note:** *request_contact* and *request_location* options will only work in Telegram versions released after 9 April, 2016. Older clients will display *unsupported message*.\n\n**Note:** *request_poll* option will only work in Telegram versions released after 23 January, 2020. Older clients will display *unsupported message*.\n\n**Note:** *web_app* option will only work in Telegram versions released after 16 April, 2022. Older clients will display *unsupported message*.",
|
||||
"description": "This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_user, request_chat, request_contact, request_location, and request_poll are mutually exclusive.\nNote: request_contact and request_location options will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.\nNote: request_poll option will only work in Telegram versions released after 23 January, 2020. Older clients will display unsupported message.\nNote: web_app option will only work in Telegram versions released after 16 April, 2022. Older clients will display unsupported message.\nNote: request_user and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.",
|
||||
"html_description": "<p>This object represents one button of the reply keyboard. For simple text buttons, <em>String</em> can be used instead of this object to specify the button text. The optional fields <em>web_app</em>, <em>request_user</em>, <em>request_chat</em>, <em>request_contact</em>, <em>request_location</em>, and <em>request_poll</em> are mutually exclusive.</p><p><strong>Note:</strong> <em>request_contact</em> and <em>request_location</em> options will only work in Telegram versions released after 9 April, 2016. Older clients will display <em>unsupported message</em>.<br/>\n<strong>Note:</strong> <em>request_poll</em> option will only work in Telegram versions released after 23 January, 2020. Older clients will display <em>unsupported message</em>.<br/>\n<strong>Note:</strong> <em>web_app</em> option will only work in Telegram versions released after 16 April, 2022. Older clients will display <em>unsupported message</em>.<br/>\n<strong>Note:</strong> <em>request_user</em> and <em>request_chat</em> options will only work in Telegram versions released after 3 February, 2023. Older clients will display <em>unsupported message</em>.</p>",
|
||||
"rst_description": "This object represents one button of the reply keyboard. For simple text buttons, *String* can be used instead of this object to specify the button text. The optional fields *web_app*, *request_user*, *request_chat*, *request_contact*, *request_location*, and *request_poll* are mutually exclusive.\n**Note:** *request_contact* and *request_location* options will only work in Telegram versions released after 9 April, 2016. Older clients will display *unsupported message*.\n\n**Note:** *request_poll* option will only work in Telegram versions released after 23 January, 2020. Older clients will display *unsupported message*.\n\n**Note:** *web_app* option will only work in Telegram versions released after 16 April, 2022. Older clients will display *unsupported message*.\n\n**Note:** *request_user* and *request_chat* options will only work in Telegram versions released after 3 February, 2023. Older clients will display *unsupported message*.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "String",
|
||||
|
|
@ -2581,6 +2649,22 @@
|
|||
"name": "text",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "KeyboardButtonRequestUser",
|
||||
"description": "If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a 'user_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. Tapping on any user will send their identifier to the bot in a “user_shared” service message. Available in private chats only.</td>",
|
||||
"rst_description": "*Optional.* If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a 'user_shared' service message. Available in private chats only.\n",
|
||||
"name": "request_user",
|
||||
"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 “chat_shared” 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
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only.",
|
||||
|
|
@ -2616,6 +2700,114 @@
|
|||
],
|
||||
"category": "types"
|
||||
},
|
||||
{
|
||||
"anchor": "keyboardbuttonrequestuser",
|
||||
"name": "KeyboardButtonRequestUser",
|
||||
"description": "This object defines the criteria used to request a suitable user. The identifier of the selected user will be shared with the bot when the corresponding button is pressed.",
|
||||
"html_description": "<p>This object defines the criteria used to request a suitable user. The identifier of the selected user will be shared with the bot when the corresponding button is pressed.</p>",
|
||||
"rst_description": "This object defines the criteria used to request a suitable user. The identifier of the selected user will be shared with the bot when the corresponding button is pressed.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "Integer",
|
||||
"description": "Signed 32-bit identifier of the request, which will be received back in the UserShared object. Must be unique within the message",
|
||||
"html_description": "<td>Signed 32-bit identifier of the request, which will be received back in the <a href=\"#usershared\">UserShared</a> object. Must be unique within the message</td>",
|
||||
"rst_description": "Signed 32-bit identifier of the request, which will be received back in the :class:`aiogram.types.user_shared.UserShared` object. Must be unique within the message\n",
|
||||
"name": "request_id",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "Pass True to request a bot, pass False to request a regular user. If not specified, no additional restrictions are applied.",
|
||||
"html_description": "<td><em>Optional</em>. Pass <em>True</em> to request a bot, pass <em>False</em> to request a regular user. If not specified, no additional restrictions are applied.</td>",
|
||||
"rst_description": "*Optional*. Pass :code:`True` to request a bot, pass :code:`False` to request a regular user. If not specified, no additional restrictions are applied.\n",
|
||||
"name": "user_is_bot",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "Pass True to request a premium user, pass False to request a non-premium user. If not specified, no additional restrictions are applied.",
|
||||
"html_description": "<td><em>Optional</em>. Pass <em>True</em> to request a premium user, pass <em>False</em> to request a non-premium user. If not specified, no additional restrictions are applied.</td>",
|
||||
"rst_description": "*Optional*. Pass :code:`True` to request a premium user, pass :code:`False` to request a non-premium user. If not specified, no additional restrictions are applied.\n",
|
||||
"name": "user_is_premium",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"category": "types"
|
||||
},
|
||||
{
|
||||
"anchor": "keyboardbuttonrequestchat",
|
||||
"name": "KeyboardButtonRequestChat",
|
||||
"description": "This object defines the criteria used to request a suitable chat. The identifier of the selected chat will be shared with the bot when the corresponding button is pressed.",
|
||||
"html_description": "<p>This object defines the criteria used to request a suitable chat. The identifier of the selected chat will be shared with the bot when the corresponding button is pressed.</p>",
|
||||
"rst_description": "This object defines the criteria used to request a suitable chat. The identifier of the selected chat will be shared with the bot when the corresponding button is pressed.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "Integer",
|
||||
"description": "Signed 32-bit identifier of the request, which will be received back in the ChatShared object. Must be unique within the message",
|
||||
"html_description": "<td>Signed 32-bit identifier of the request, which will be received back in the <a href=\"#chatshared\">ChatShared</a> object. Must be unique within the message</td>",
|
||||
"rst_description": "Signed 32-bit identifier of the request, which will be received back in the :class:`aiogram.types.chat_shared.ChatShared` object. Must be unique within the message\n",
|
||||
"name": "request_id",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "Pass True to request a channel chat, pass False to request a group or a supergroup chat.",
|
||||
"html_description": "<td>Pass <em>True</em> to request a channel chat, pass <em>False</em> to request a group or a supergroup chat.</td>",
|
||||
"rst_description": "Pass :code:`True` to request a channel chat, pass :code:`False` to request a group or a supergroup chat.\n",
|
||||
"name": "chat_is_channel",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "Pass True to request a forum supergroup, pass False to request a non-forum chat. If not specified, no additional restrictions are applied.",
|
||||
"html_description": "<td><em>Optional</em>. Pass <em>True</em> to request a forum supergroup, pass <em>False</em> to request a non-forum chat. If not specified, no additional restrictions are applied.</td>",
|
||||
"rst_description": "*Optional*. Pass :code:`True` to request a forum supergroup, pass :code:`False` to request a non-forum chat. If not specified, no additional restrictions are applied.\n",
|
||||
"name": "chat_is_forum",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "Pass True to request a supergroup or a channel with a username, pass False to request a chat without a username. If not specified, no additional restrictions are applied.",
|
||||
"html_description": "<td><em>Optional</em>. Pass <em>True</em> to request a supergroup or a channel with a username, pass <em>False</em> to request a chat without a username. If not specified, no additional restrictions are applied.</td>",
|
||||
"rst_description": "*Optional*. Pass :code:`True` to request a supergroup or a channel with a username, pass :code:`False` to request a chat without a username. If not specified, no additional restrictions are applied.\n",
|
||||
"name": "chat_has_username",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "Pass True to request a chat owned by the user. Otherwise, no additional restrictions are applied.",
|
||||
"html_description": "<td><em>Optional</em>. Pass <em>True</em> to request a chat owned by the user. Otherwise, no additional restrictions are applied.</td>",
|
||||
"rst_description": "*Optional*. Pass :code:`True` to request a chat owned by the user. Otherwise, no additional restrictions are applied.\n",
|
||||
"name": "chat_is_created",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "ChatAdministratorRights",
|
||||
"description": "A JSON-serialized object listing the required administrator rights of the user in the chat. The rights must be a superset of bot_administrator_rights. If not specified, no additional restrictions are applied.",
|
||||
"html_description": "<td><em>Optional</em>. A JSON-serialized object listing the required administrator rights of the user in the chat. The rights must be a superset of <em>bot_administrator_rights</em>. If not specified, no additional restrictions are applied.</td>",
|
||||
"rst_description": "*Optional*. A JSON-serialized object listing the required administrator rights of the user in the chat. The rights must be a superset of *bot_administrator_rights*. If not specified, no additional restrictions are applied.\n",
|
||||
"name": "user_administrator_rights",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "ChatAdministratorRights",
|
||||
"description": "A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset of user_administrator_rights. If not specified, no additional restrictions are applied.",
|
||||
"html_description": "<td><em>Optional</em>. A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset of <em>user_administrator_rights</em>. If not specified, no additional restrictions are applied.</td>",
|
||||
"rst_description": "*Optional*. A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset of *user_administrator_rights*. If not specified, no additional restrictions are applied.\n",
|
||||
"name": "bot_administrator_rights",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "Pass True to request a chat with the bot as a member. Otherwise, no additional restrictions are applied.",
|
||||
"html_description": "<td><em>Optional</em>. Pass <em>True</em> to request a chat with the bot as a member. Otherwise, no additional restrictions are applied.</td>",
|
||||
"rst_description": "*Optional*. Pass :code:`True` to request a chat with the bot as a member. Otherwise, no additional restrictions are applied.\n",
|
||||
"name": "bot_is_member",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"category": "types"
|
||||
},
|
||||
{
|
||||
"anchor": "keyboardbuttonpolltype",
|
||||
"name": "KeyboardButtonPollType",
|
||||
|
|
@ -3075,9 +3267,9 @@
|
|||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)",
|
||||
"html_description": "<td><em>True</em>, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)</td>",
|
||||
"rst_description": ":code:`True`, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)\n",
|
||||
"description": "True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user)",
|
||||
"html_description": "<td><em>True</em>, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user)</td>",
|
||||
"rst_description": ":code:`True`, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user)\n",
|
||||
"name": "can_promote_members",
|
||||
"required": true
|
||||
},
|
||||
|
|
@ -3256,9 +3448,9 @@
|
|||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)",
|
||||
"html_description": "<td><em>True</em>, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)</td>",
|
||||
"rst_description": ":code:`True`, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)\n",
|
||||
"description": "True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user)",
|
||||
"html_description": "<td><em>True</em>, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user)</td>",
|
||||
"rst_description": ":code:`True`, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user)\n",
|
||||
"name": "can_promote_members",
|
||||
"required": true
|
||||
},
|
||||
|
|
@ -3378,6 +3570,86 @@
|
|||
"name": "is_member",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send text messages, contacts, invoices, locations and venues",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to send text messages, contacts, invoices, locations and venues</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to send text messages, contacts, invoices, locations and venues\n",
|
||||
"name": "can_send_messages",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send audios",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to send audios</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to send audios\n",
|
||||
"name": "can_send_audios",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send documents",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to send documents</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to send documents\n",
|
||||
"name": "can_send_documents",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send photos",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to send photos</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to send photos\n",
|
||||
"name": "can_send_photos",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send videos",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to send videos</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to send videos\n",
|
||||
"name": "can_send_videos",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send video notes",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to send video notes</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to send video notes\n",
|
||||
"name": "can_send_video_notes",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send voice notes",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to send voice notes</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to send voice notes\n",
|
||||
"name": "can_send_voice_notes",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send polls",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to send polls</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to send polls\n",
|
||||
"name": "can_send_polls",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send animations, games, stickers and use inline bots",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to send animations, games, stickers and use inline bots</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to send animations, games, stickers and use inline bots\n",
|
||||
"name": "can_send_other_messages",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to add web page previews to their messages",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to add web page previews to their messages</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to add web page previews to their messages\n",
|
||||
"name": "can_add_web_page_previews",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to change the chat title, photo and other settings",
|
||||
|
|
@ -3410,46 +3682,6 @@
|
|||
"name": "can_manage_topics",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send text messages, contacts, locations and venues",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to send text messages, contacts, locations and venues</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to send text messages, contacts, locations and venues\n",
|
||||
"name": "can_send_messages",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes\n",
|
||||
"name": "can_send_media_messages",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send polls",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to send polls</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to send polls\n",
|
||||
"name": "can_send_polls",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send animations, games, stickers and use inline bots",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to send animations, games, stickers and use inline bots</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to send animations, games, stickers and use inline bots\n",
|
||||
"name": "can_send_other_messages",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to add web page previews to their messages",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to add web page previews to their messages</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to add web page previews to their messages\n",
|
||||
"name": "can_add_web_page_previews",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Integer",
|
||||
"description": "Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever",
|
||||
|
|
@ -3602,6 +3834,14 @@
|
|||
"name": "from",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Integer",
|
||||
"description": "Identifier of a private chat with the user who sent the join request. 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. The bot can use this identifier for 24 hours to send messages until the join request is processed, assuming no other administrator contacted the user.",
|
||||
"html_description": "<td>Identifier of a private chat with the user who sent the join request. 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. The bot can use this identifier for 24 hours to send messages until the join request is processed, assuming no other administrator contacted the user.</td>",
|
||||
"rst_description": "Identifier of a private chat with the user who sent the join request. 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. The bot can use this identifier for 24 hours to send messages until the join request is processed, assuming no other administrator contacted the user.\n",
|
||||
"name": "user_chat_id",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Integer",
|
||||
"description": "Date the request was sent in Unix time",
|
||||
|
|
@ -3638,41 +3878,81 @@
|
|||
"annotations": [
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send text messages, contacts, locations and venues",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to send text messages, contacts, locations and venues</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to send text messages, contacts, locations and venues\n",
|
||||
"description": "True, if the user is allowed to send text messages, contacts, invoices, locations and venues",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to send text messages, contacts, invoices, locations and venues</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to send text messages, contacts, invoices, locations and venues\n",
|
||||
"name": "can_send_messages",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages\n",
|
||||
"name": "can_send_media_messages",
|
||||
"description": "True, if the user is allowed to send audios",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to send audios</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to send audios\n",
|
||||
"name": "can_send_audios",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send polls, implies can_send_messages",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to send polls, implies can_send_messages</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to send polls, implies can_send_messages\n",
|
||||
"description": "True, if the user is allowed to send documents",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to send documents</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to send documents\n",
|
||||
"name": "can_send_documents",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send photos",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to send photos</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to send photos\n",
|
||||
"name": "can_send_photos",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send videos",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to send videos</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to send videos\n",
|
||||
"name": "can_send_videos",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send video notes",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to send video notes</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to send video notes\n",
|
||||
"name": "can_send_video_notes",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send voice notes",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to send voice notes</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to send voice notes\n",
|
||||
"name": "can_send_voice_notes",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send polls",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to send polls</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to send polls\n",
|
||||
"name": "can_send_polls",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages\n",
|
||||
"description": "True, if the user is allowed to send animations, games, stickers and use inline bots",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to send animations, games, stickers and use inline bots</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to send animations, games, stickers and use inline bots\n",
|
||||
"name": "can_send_other_messages",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to add web page previews to their messages, implies can_send_media_messages",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to add web page previews to their messages, implies can_send_media_messages</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to add web page previews to their messages, implies can_send_media_messages\n",
|
||||
"description": "True, if the user is allowed to add web page previews to their messages",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to add web page previews to their messages</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to add web page previews to their messages\n",
|
||||
"name": "can_add_web_page_previews",
|
||||
"required": false
|
||||
},
|
||||
|
|
@ -6584,6 +6864,14 @@
|
|||
"rst_description": "A JSON-serialized object for new user permissions\n",
|
||||
"name": "permissions"
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"required": false,
|
||||
"description": "Pass True if chat permissions are set independently. Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission.",
|
||||
"html_description": "<td>Pass <em>True</em> if chat permissions are set independently. Otherwise, the <em>can_send_other_messages</em> and <em>can_add_web_page_previews</em> permissions will imply the <em>can_send_messages</em>, <em>can_send_audios</em>, <em>can_send_documents</em>, <em>can_send_photos</em>, <em>can_send_videos</em>, <em>can_send_video_notes</em>, and <em>can_send_voice_notes</em> permissions; the <em>can_send_polls</em> permission will imply the <em>can_send_messages</em> permission.</td>",
|
||||
"rst_description": "Pass :code:`True` if chat permissions are set independently. Otherwise, the *can_send_other_messages* and *can_add_web_page_previews* permissions will imply the *can_send_messages*, *can_send_audios*, *can_send_documents*, *can_send_photos*, *can_send_videos*, *can_send_video_notes*, and *can_send_voice_notes* permissions; the *can_send_polls* permission will imply the *can_send_messages* permission.\n",
|
||||
"name": "use_independent_chat_permissions"
|
||||
},
|
||||
{
|
||||
"type": "Integer",
|
||||
"required": false,
|
||||
|
|
@ -6677,9 +6965,9 @@
|
|||
{
|
||||
"type": "Boolean",
|
||||
"required": false,
|
||||
"description": "Pass True if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him)",
|
||||
"html_description": "<td>Pass <em>True</em> if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him)</td>",
|
||||
"rst_description": "Pass :code:`True` if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him)\n",
|
||||
"description": "Pass True if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him)",
|
||||
"html_description": "<td>Pass <em>True</em> if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him)</td>",
|
||||
"rst_description": "Pass :code:`True` if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him)\n",
|
||||
"name": "can_promote_members"
|
||||
},
|
||||
{
|
||||
|
|
@ -6825,6 +7113,14 @@
|
|||
"html_description": "<td>A JSON-serialized object for new default chat permissions</td>",
|
||||
"rst_description": "A JSON-serialized object for new default chat permissions\n",
|
||||
"name": "permissions"
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"required": false,
|
||||
"description": "Pass True if chat permissions are set independently. Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission.",
|
||||
"html_description": "<td>Pass <em>True</em> if chat permissions are set independently. Otherwise, the <em>can_send_other_messages</em> and <em>can_add_web_page_previews</em> permissions will imply the <em>can_send_messages</em>, <em>can_send_audios</em>, <em>can_send_documents</em>, <em>can_send_photos</em>, <em>can_send_videos</em>, <em>can_send_video_notes</em>, and <em>can_send_voice_notes</em> permissions; the <em>can_send_polls</em> permission will imply the <em>can_send_messages</em> permission.</td>",
|
||||
"rst_description": "Pass :code:`True` if chat permissions are set independently. Otherwise, the *can_send_other_messages* and *can_add_web_page_previews* permissions will imply the *can_send_messages*, *can_send_audios*, *can_send_documents*, *can_send_photos*, *can_send_videos*, *can_send_video_notes*, and *can_send_voice_notes* permissions; the *can_send_polls* permission will imply the *can_send_messages* permission.\n",
|
||||
"name": "use_independent_chat_permissions"
|
||||
}
|
||||
],
|
||||
"category": "methods"
|
||||
|
|
@ -7282,9 +7578,9 @@
|
|||
{
|
||||
"anchor": "getchatmember",
|
||||
"name": "getChatMember",
|
||||
"description": "Use this method to get information about a member of a chat. The method is guaranteed to work for other users, only if the bot is an administrator in the chat. Returns a ChatMember object on success.",
|
||||
"html_description": "<p>Use this method to get information about a member of a chat. The method is guaranteed to work for other users, only if the bot is an administrator in the chat. Returns a <a href=\"#chatmember\">ChatMember</a> object on success.</p>",
|
||||
"rst_description": "Use this method to get information about a member of a chat. The method is guaranteed to work for other users, only if the bot is an administrator in the chat. Returns a :class:`aiogram.types.chat_member.ChatMember` object on success.",
|
||||
"description": "Use this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat. Returns a ChatMember object on success.",
|
||||
"html_description": "<p>Use this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat. Returns a <a href=\"#chatmember\">ChatMember</a> object on success.</p>",
|
||||
"rst_description": "Use this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat. Returns a :class:`aiogram.types.chat_member.ChatMember` object on success.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "Integer or String",
|
||||
|
|
|
|||
|
|
@ -55,9 +55,9 @@
|
|||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)",
|
||||
"html_description": "<td><em>True</em>, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)</td>",
|
||||
"rst_description": ":code:`True`, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)\n",
|
||||
"description": "True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user)",
|
||||
"html_description": "<td><em>True</em>, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user)</td>",
|
||||
"rst_description": ":code:`True`, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user)\n",
|
||||
"name": "can_promote_members",
|
||||
"required": true
|
||||
},
|
||||
|
|
|
|||
|
|
@ -29,6 +29,14 @@
|
|||
"name": "from",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Integer",
|
||||
"description": "Identifier of a private chat with the user who sent the join request. 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. The bot can use this identifier for 24 hours to send messages until the join request is processed, assuming no other administrator contacted the user.",
|
||||
"html_description": "<td>Identifier of a private chat with the user who sent the join request. 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. The bot can use this identifier for 24 hours to send messages until the join request is processed, assuming no other administrator contacted the user.</td>",
|
||||
"rst_description": "Identifier of a private chat with the user who sent the join request. 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. The bot can use this identifier for 24 hours to send messages until the join request is processed, assuming no other administrator contacted the user.\n",
|
||||
"name": "user_chat_id",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Integer",
|
||||
"description": "Date the request was sent in Unix time",
|
||||
|
|
|
|||
|
|
@ -79,9 +79,9 @@
|
|||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)",
|
||||
"html_description": "<td><em>True</em>, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)</td>",
|
||||
"rst_description": ":code:`True`, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)\n",
|
||||
"description": "True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user)",
|
||||
"html_description": "<td><em>True</em>, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user)</td>",
|
||||
"rst_description": ":code:`True`, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user)\n",
|
||||
"name": "can_promote_members",
|
||||
"required": true
|
||||
},
|
||||
|
|
|
|||
|
|
@ -37,6 +37,86 @@
|
|||
"name": "is_member",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send text messages, contacts, invoices, locations and venues",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to send text messages, contacts, invoices, locations and venues</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to send text messages, contacts, invoices, locations and venues\n",
|
||||
"name": "can_send_messages",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send audios",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to send audios</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to send audios\n",
|
||||
"name": "can_send_audios",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send documents",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to send documents</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to send documents\n",
|
||||
"name": "can_send_documents",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send photos",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to send photos</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to send photos\n",
|
||||
"name": "can_send_photos",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send videos",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to send videos</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to send videos\n",
|
||||
"name": "can_send_videos",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send video notes",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to send video notes</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to send video notes\n",
|
||||
"name": "can_send_video_notes",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send voice notes",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to send voice notes</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to send voice notes\n",
|
||||
"name": "can_send_voice_notes",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send polls",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to send polls</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to send polls\n",
|
||||
"name": "can_send_polls",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send animations, games, stickers and use inline bots",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to send animations, games, stickers and use inline bots</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to send animations, games, stickers and use inline bots\n",
|
||||
"name": "can_send_other_messages",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to add web page previews to their messages",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to add web page previews to their messages</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to add web page previews to their messages\n",
|
||||
"name": "can_add_web_page_previews",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to change the chat title, photo and other settings",
|
||||
|
|
@ -69,46 +149,6 @@
|
|||
"name": "can_manage_topics",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send text messages, contacts, locations and venues",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to send text messages, contacts, locations and venues</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to send text messages, contacts, locations and venues\n",
|
||||
"name": "can_send_messages",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes\n",
|
||||
"name": "can_send_media_messages",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send polls",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to send polls</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to send polls\n",
|
||||
"name": "can_send_polls",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send animations, games, stickers and use inline bots",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to send animations, games, stickers and use inline bots</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to send animations, games, stickers and use inline bots\n",
|
||||
"name": "can_send_other_messages",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to add web page previews to their messages",
|
||||
"html_description": "<td><em>True</em>, if the user is allowed to add web page previews to their messages</td>",
|
||||
"rst_description": ":code:`True`, if the user is allowed to add web page previews to their messages\n",
|
||||
"name": "can_add_web_page_previews",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Integer",
|
||||
"description": "Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever",
|
||||
|
|
|
|||
|
|
@ -15,41 +15,81 @@
|
|||
"annotations": [
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send text messages, contacts, locations and venues",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to send text messages, contacts, locations and venues</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to send text messages, contacts, locations and venues\n",
|
||||
"description": "True, if the user is allowed to send text messages, contacts, invoices, locations and venues",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to send text messages, contacts, invoices, locations and venues</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to send text messages, contacts, invoices, locations and venues\n",
|
||||
"name": "can_send_messages",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages\n",
|
||||
"name": "can_send_media_messages",
|
||||
"description": "True, if the user is allowed to send audios",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to send audios</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to send audios\n",
|
||||
"name": "can_send_audios",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send polls, implies can_send_messages",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to send polls, implies can_send_messages</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to send polls, implies can_send_messages\n",
|
||||
"description": "True, if the user is allowed to send documents",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to send documents</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to send documents\n",
|
||||
"name": "can_send_documents",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send photos",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to send photos</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to send photos\n",
|
||||
"name": "can_send_photos",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send videos",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to send videos</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to send videos\n",
|
||||
"name": "can_send_videos",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send video notes",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to send video notes</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to send video notes\n",
|
||||
"name": "can_send_video_notes",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send voice notes",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to send voice notes</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to send voice notes\n",
|
||||
"name": "can_send_voice_notes",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send polls",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to send polls</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to send polls\n",
|
||||
"name": "can_send_polls",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages\n",
|
||||
"description": "True, if the user is allowed to send animations, games, stickers and use inline bots",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to send animations, games, stickers and use inline bots</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to send animations, games, stickers and use inline bots\n",
|
||||
"name": "can_send_other_messages",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "True, if the user is allowed to add web page previews to their messages, implies can_send_media_messages",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to add web page previews to their messages, implies can_send_media_messages</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to add web page previews to their messages, implies can_send_media_messages\n",
|
||||
"description": "True, if the user is allowed to add web page previews to their messages",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to add web page previews to their messages</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the user is allowed to add web page previews to their messages\n",
|
||||
"name": "can_add_web_page_previews",
|
||||
"required": false
|
||||
},
|
||||
|
|
|
|||
35
.butcher/types/ChatShared/entity.json
Normal file
35
.butcher/types/ChatShared/entity.json
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"meta": {
|
||||
"deprecated": false
|
||||
},
|
||||
"group": {
|
||||
"title": "Available types",
|
||||
"anchor": "available-types"
|
||||
},
|
||||
"object": {
|
||||
"anchor": "chatshared",
|
||||
"name": "ChatShared",
|
||||
"description": "This object contains information about the chat whose identifier was shared with the bot using a KeyboardButtonRequestChat button.",
|
||||
"html_description": "<p>This object contains information about the chat whose identifier was shared with the bot using a <a href=\"#keyboardbuttonrequestchat\">KeyboardButtonRequestChat</a> button.</p>",
|
||||
"rst_description": "This object contains information about the chat whose identifier was shared with the bot using a :class:`aiogram.types.keyboard_button_request_chat.KeyboardButtonRequestChat` button.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "Integer",
|
||||
"description": "Identifier of the request",
|
||||
"html_description": "<td>Identifier of the request</td>",
|
||||
"rst_description": "Identifier of the request\n",
|
||||
"name": "request_id",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Integer",
|
||||
"description": "Identifier of the shared chat. 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. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means.",
|
||||
"html_description": "<td>Identifier of the shared chat. 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. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means.</td>",
|
||||
"rst_description": "Identifier of the shared chat. 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. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means.\n",
|
||||
"name": "chat_id",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"category": "types"
|
||||
}
|
||||
}
|
||||
|
|
@ -9,9 +9,9 @@
|
|||
"object": {
|
||||
"anchor": "keyboardbutton",
|
||||
"name": "KeyboardButton",
|
||||
"description": "This object represents one button of the reply keyboard. For simple text buttons String can be used instead of this object to specify text of the button. Optional fields web_app, request_contact, request_location, and request_poll are mutually exclusive.\nNote: request_contact and request_location options will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.\nNote: request_poll option will only work in Telegram versions released after 23 January, 2020. Older clients will display unsupported message.\nNote: web_app option will only work in Telegram versions released after 16 April, 2022. Older clients will display unsupported message.",
|
||||
"html_description": "<p>This object represents one button of the reply keyboard. For simple text buttons <em>String</em> can be used instead of this object to specify text of the button. Optional fields <em>web_app</em>, <em>request_contact</em>, <em>request_location</em>, and <em>request_poll</em> are mutually exclusive.</p><p><strong>Note:</strong> <em>request_contact</em> and <em>request_location</em> options will only work in Telegram versions released after 9 April, 2016. Older clients will display <em>unsupported message</em>.<br/>\n<strong>Note:</strong> <em>request_poll</em> option will only work in Telegram versions released after 23 January, 2020. Older clients will display <em>unsupported message</em>.<br/>\n<strong>Note:</strong> <em>web_app</em> option will only work in Telegram versions released after 16 April, 2022. Older clients will display <em>unsupported message</em>.</p>",
|
||||
"rst_description": "This object represents one button of the reply keyboard. For simple text buttons *String* can be used instead of this object to specify text of the button. Optional fields *web_app*, *request_contact*, *request_location*, and *request_poll* are mutually exclusive.\n**Note:** *request_contact* and *request_location* options will only work in Telegram versions released after 9 April, 2016. Older clients will display *unsupported message*.\n\n**Note:** *request_poll* option will only work in Telegram versions released after 23 January, 2020. Older clients will display *unsupported message*.\n\n**Note:** *web_app* option will only work in Telegram versions released after 16 April, 2022. Older clients will display *unsupported message*.",
|
||||
"description": "This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_user, request_chat, request_contact, request_location, and request_poll are mutually exclusive.\nNote: request_contact and request_location options will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.\nNote: request_poll option will only work in Telegram versions released after 23 January, 2020. Older clients will display unsupported message.\nNote: web_app option will only work in Telegram versions released after 16 April, 2022. Older clients will display unsupported message.\nNote: request_user and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.",
|
||||
"html_description": "<p>This object represents one button of the reply keyboard. For simple text buttons, <em>String</em> can be used instead of this object to specify the button text. The optional fields <em>web_app</em>, <em>request_user</em>, <em>request_chat</em>, <em>request_contact</em>, <em>request_location</em>, and <em>request_poll</em> are mutually exclusive.</p><p><strong>Note:</strong> <em>request_contact</em> and <em>request_location</em> options will only work in Telegram versions released after 9 April, 2016. Older clients will display <em>unsupported message</em>.<br/>\n<strong>Note:</strong> <em>request_poll</em> option will only work in Telegram versions released after 23 January, 2020. Older clients will display <em>unsupported message</em>.<br/>\n<strong>Note:</strong> <em>web_app</em> option will only work in Telegram versions released after 16 April, 2022. Older clients will display <em>unsupported message</em>.<br/>\n<strong>Note:</strong> <em>request_user</em> and <em>request_chat</em> options will only work in Telegram versions released after 3 February, 2023. Older clients will display <em>unsupported message</em>.</p>",
|
||||
"rst_description": "This object represents one button of the reply keyboard. For simple text buttons, *String* can be used instead of this object to specify the button text. The optional fields *web_app*, *request_user*, *request_chat*, *request_contact*, *request_location*, and *request_poll* are mutually exclusive.\n**Note:** *request_contact* and *request_location* options will only work in Telegram versions released after 9 April, 2016. Older clients will display *unsupported message*.\n\n**Note:** *request_poll* option will only work in Telegram versions released after 23 January, 2020. Older clients will display *unsupported message*.\n\n**Note:** *web_app* option will only work in Telegram versions released after 16 April, 2022. Older clients will display *unsupported message*.\n\n**Note:** *request_user* and *request_chat* options will only work in Telegram versions released after 3 February, 2023. Older clients will display *unsupported message*.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "String",
|
||||
|
|
@ -21,6 +21,22 @@
|
|||
"name": "text",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "KeyboardButtonRequestUser",
|
||||
"description": "If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a 'user_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. Tapping on any user will send their identifier to the bot in a “user_shared” service message. Available in private chats only.</td>",
|
||||
"rst_description": "*Optional.* If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a 'user_shared' service message. Available in private chats only.\n",
|
||||
"name": "request_user",
|
||||
"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 “chat_shared” 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
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only.",
|
||||
|
|
|
|||
83
.butcher/types/KeyboardButtonRequestChat/entity.json
Normal file
83
.butcher/types/KeyboardButtonRequestChat/entity.json
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
{
|
||||
"meta": {
|
||||
"deprecated": false
|
||||
},
|
||||
"group": {
|
||||
"title": "Available types",
|
||||
"anchor": "available-types"
|
||||
},
|
||||
"object": {
|
||||
"anchor": "keyboardbuttonrequestchat",
|
||||
"name": "KeyboardButtonRequestChat",
|
||||
"description": "This object defines the criteria used to request a suitable chat. The identifier of the selected chat will be shared with the bot when the corresponding button is pressed.",
|
||||
"html_description": "<p>This object defines the criteria used to request a suitable chat. The identifier of the selected chat will be shared with the bot when the corresponding button is pressed.</p>",
|
||||
"rst_description": "This object defines the criteria used to request a suitable chat. The identifier of the selected chat will be shared with the bot when the corresponding button is pressed.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "Integer",
|
||||
"description": "Signed 32-bit identifier of the request, which will be received back in the ChatShared object. Must be unique within the message",
|
||||
"html_description": "<td>Signed 32-bit identifier of the request, which will be received back in the <a href=\"#chatshared\">ChatShared</a> object. Must be unique within the message</td>",
|
||||
"rst_description": "Signed 32-bit identifier of the request, which will be received back in the :class:`aiogram.types.chat_shared.ChatShared` object. Must be unique within the message\n",
|
||||
"name": "request_id",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "Pass True to request a channel chat, pass False to request a group or a supergroup chat.",
|
||||
"html_description": "<td>Pass <em>True</em> to request a channel chat, pass <em>False</em> to request a group or a supergroup chat.</td>",
|
||||
"rst_description": "Pass :code:`True` to request a channel chat, pass :code:`False` to request a group or a supergroup chat.\n",
|
||||
"name": "chat_is_channel",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "Pass True to request a forum supergroup, pass False to request a non-forum chat. If not specified, no additional restrictions are applied.",
|
||||
"html_description": "<td><em>Optional</em>. Pass <em>True</em> to request a forum supergroup, pass <em>False</em> to request a non-forum chat. If not specified, no additional restrictions are applied.</td>",
|
||||
"rst_description": "*Optional*. Pass :code:`True` to request a forum supergroup, pass :code:`False` to request a non-forum chat. If not specified, no additional restrictions are applied.\n",
|
||||
"name": "chat_is_forum",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "Pass True to request a supergroup or a channel with a username, pass False to request a chat without a username. If not specified, no additional restrictions are applied.",
|
||||
"html_description": "<td><em>Optional</em>. Pass <em>True</em> to request a supergroup or a channel with a username, pass <em>False</em> to request a chat without a username. If not specified, no additional restrictions are applied.</td>",
|
||||
"rst_description": "*Optional*. Pass :code:`True` to request a supergroup or a channel with a username, pass :code:`False` to request a chat without a username. If not specified, no additional restrictions are applied.\n",
|
||||
"name": "chat_has_username",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "Pass True to request a chat owned by the user. Otherwise, no additional restrictions are applied.",
|
||||
"html_description": "<td><em>Optional</em>. Pass <em>True</em> to request a chat owned by the user. Otherwise, no additional restrictions are applied.</td>",
|
||||
"rst_description": "*Optional*. Pass :code:`True` to request a chat owned by the user. Otherwise, no additional restrictions are applied.\n",
|
||||
"name": "chat_is_created",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "ChatAdministratorRights",
|
||||
"description": "A JSON-serialized object listing the required administrator rights of the user in the chat. The rights must be a superset of bot_administrator_rights. If not specified, no additional restrictions are applied.",
|
||||
"html_description": "<td><em>Optional</em>. A JSON-serialized object listing the required administrator rights of the user in the chat. The rights must be a superset of <em>bot_administrator_rights</em>. If not specified, no additional restrictions are applied.</td>",
|
||||
"rst_description": "*Optional*. A JSON-serialized object listing the required administrator rights of the user in the chat. The rights must be a superset of *bot_administrator_rights*. If not specified, no additional restrictions are applied.\n",
|
||||
"name": "user_administrator_rights",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "ChatAdministratorRights",
|
||||
"description": "A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset of user_administrator_rights. If not specified, no additional restrictions are applied.",
|
||||
"html_description": "<td><em>Optional</em>. A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset of <em>user_administrator_rights</em>. If not specified, no additional restrictions are applied.</td>",
|
||||
"rst_description": "*Optional*. A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset of *user_administrator_rights*. If not specified, no additional restrictions are applied.\n",
|
||||
"name": "bot_administrator_rights",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "Pass True to request a chat with the bot as a member. Otherwise, no additional restrictions are applied.",
|
||||
"html_description": "<td><em>Optional</em>. Pass <em>True</em> to request a chat with the bot as a member. Otherwise, no additional restrictions are applied.</td>",
|
||||
"rst_description": "*Optional*. Pass :code:`True` to request a chat with the bot as a member. Otherwise, no additional restrictions are applied.\n",
|
||||
"name": "bot_is_member",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"category": "types"
|
||||
}
|
||||
}
|
||||
43
.butcher/types/KeyboardButtonRequestUser/entity.json
Normal file
43
.butcher/types/KeyboardButtonRequestUser/entity.json
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
"meta": {
|
||||
"deprecated": false
|
||||
},
|
||||
"group": {
|
||||
"title": "Available types",
|
||||
"anchor": "available-types"
|
||||
},
|
||||
"object": {
|
||||
"anchor": "keyboardbuttonrequestuser",
|
||||
"name": "KeyboardButtonRequestUser",
|
||||
"description": "This object defines the criteria used to request a suitable user. The identifier of the selected user will be shared with the bot when the corresponding button is pressed.",
|
||||
"html_description": "<p>This object defines the criteria used to request a suitable user. The identifier of the selected user will be shared with the bot when the corresponding button is pressed.</p>",
|
||||
"rst_description": "This object defines the criteria used to request a suitable user. The identifier of the selected user will be shared with the bot when the corresponding button is pressed.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "Integer",
|
||||
"description": "Signed 32-bit identifier of the request, which will be received back in the UserShared object. Must be unique within the message",
|
||||
"html_description": "<td>Signed 32-bit identifier of the request, which will be received back in the <a href=\"#usershared\">UserShared</a> object. Must be unique within the message</td>",
|
||||
"rst_description": "Signed 32-bit identifier of the request, which will be received back in the :class:`aiogram.types.user_shared.UserShared` object. Must be unique within the message\n",
|
||||
"name": "request_id",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "Pass True to request a bot, pass False to request a regular user. If not specified, no additional restrictions are applied.",
|
||||
"html_description": "<td><em>Optional</em>. Pass <em>True</em> to request a bot, pass <em>False</em> to request a regular user. If not specified, no additional restrictions are applied.</td>",
|
||||
"rst_description": "*Optional*. Pass :code:`True` to request a bot, pass :code:`False` to request a regular user. If not specified, no additional restrictions are applied.\n",
|
||||
"name": "user_is_bot",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"description": "Pass True to request a premium user, pass False to request a non-premium user. If not specified, no additional restrictions are applied.",
|
||||
"html_description": "<td><em>Optional</em>. Pass <em>True</em> to request a premium user, pass <em>False</em> to request a non-premium user. If not specified, no additional restrictions are applied.</td>",
|
||||
"rst_description": "*Optional*. Pass :code:`True` to request a premium user, pass :code:`False` to request a non-premium user. If not specified, no additional restrictions are applied.\n",
|
||||
"name": "user_is_premium",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"category": "types"
|
||||
}
|
||||
}
|
||||
|
|
@ -437,6 +437,22 @@
|
|||
"name": "successful_payment",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "UserShared",
|
||||
"description": "Service message: a user was shared with the bot",
|
||||
"html_description": "<td><em>Optional</em>. Service message: a user was shared with the bot</td>",
|
||||
"rst_description": "*Optional*. Service message: a user was shared with the bot\n",
|
||||
"name": "user_shared",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "ChatShared",
|
||||
"description": "Service message: a chat was shared with the bot",
|
||||
"html_description": "<td><em>Optional</em>. Service message: a chat was shared with the bot</td>",
|
||||
"rst_description": "*Optional*. Service message: a chat was shared with the bot\n",
|
||||
"name": "chat_shared",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
"description": "The domain name of the website on which the user has logged in.",
|
||||
|
|
|
|||
35
.butcher/types/UserShared/entity.json
Normal file
35
.butcher/types/UserShared/entity.json
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"meta": {
|
||||
"deprecated": false
|
||||
},
|
||||
"group": {
|
||||
"title": "Available types",
|
||||
"anchor": "available-types"
|
||||
},
|
||||
"object": {
|
||||
"anchor": "usershared",
|
||||
"name": "UserShared",
|
||||
"description": "This object contains information about the user whose identifier was shared with the bot using a KeyboardButtonRequestUser button.",
|
||||
"html_description": "<p>This object contains information about the user whose identifier was shared with the bot using a <a href=\"#keyboardbuttonrequestuser\">KeyboardButtonRequestUser</a> button.</p>",
|
||||
"rst_description": "This object contains information about the user whose identifier was shared with the bot using a :class:`aiogram.types.keyboard_button_request_user.KeyboardButtonRequestUser` button.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "Integer",
|
||||
"description": "Identifier of the request",
|
||||
"html_description": "<td>Identifier of the request</td>",
|
||||
"rst_description": "Identifier of the request\n",
|
||||
"name": "request_id",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Integer",
|
||||
"description": "Identifier of the shared user. 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. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means.",
|
||||
"html_description": "<td>Identifier of the shared user. 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. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means.</td>",
|
||||
"rst_description": "Identifier of the shared user. 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. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means.\n",
|
||||
"name": "user_id",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"category": "types"
|
||||
}
|
||||
}
|
||||
6
CHANGES/1112.misc.rst
Normal file
6
CHANGES/1112.misc.rst
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
Added full support of `Bot API 6.5 <https://core.telegram.org/bots/api-changelog#february-3-2023>`_
|
||||
|
||||
.. danger::
|
||||
|
||||
Note that :obj:`aiogram.types.chat_permissions.ChatPermissions` is updated without
|
||||
backward compatibility, so now this object has no :code:`can_send_media_messages` attribute
|
||||
|
|
@ -1,9 +1,8 @@
|
|||
from contextlib import suppress
|
||||
|
||||
from aiogram.dispatcher.flags import FlagGenerator
|
||||
from . import methods
|
||||
from . import types
|
||||
from . import enums
|
||||
|
||||
from . import enums, methods, types
|
||||
from .client import session
|
||||
from .client.bot import Bot
|
||||
from .dispatcher.dispatcher import Dispatcher
|
||||
|
|
|
|||
|
|
@ -401,6 +401,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to add a new sticker to a set created by the bot. You **must** use exactly one of the fields *png_sticker*, *tgs_sticker*, or *webm_sticker*. Animated stickers can be added to animated sticker sets and only to them. Animated sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#addstickertoset
|
||||
|
||||
:param user_id: User identifier of sticker set owner
|
||||
:param name: Sticker set name
|
||||
:param emojis: One or more emoji corresponding to the sticker
|
||||
|
|
@ -437,6 +439,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
|
||||
Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via `@BotFather <https://t.me/botfather>`_ and accept the terms. Otherwise, you may use links like :code:`t.me/your_bot?start=XXXX` that open your bot with a parameter.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#answercallbackquery
|
||||
|
||||
:param callback_query_id: Unique identifier for the query to be answered
|
||||
:param text: Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters
|
||||
:param show_alert: 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*.
|
||||
|
|
@ -471,6 +475,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
|
||||
No more than **50** results per query are allowed.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#answerinlinequery
|
||||
|
||||
:param inline_query_id: Unique identifier for the answered query
|
||||
:param results: A JSON-serialized array of results for the inline query
|
||||
:param cache_time: The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300.
|
||||
|
|
@ -503,6 +509,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an :class:`aiogram.types.update.Update` with the field *pre_checkout_query*. Use this method to respond to such pre-checkout queries. On success, :code:`True` is returned. **Note:** The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#answerprecheckoutquery
|
||||
|
||||
:param pre_checkout_query_id: Unique identifier for the query to be answered
|
||||
:param ok: 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.
|
||||
:param error_message: 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.
|
||||
|
|
@ -528,6 +536,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
If you sent an invoice requesting a shipping address and the parameter *is_flexible* was specified, the Bot API will send an :class:`aiogram.types.update.Update` with a *shipping_query* field to the bot. Use this method to reply to shipping queries. On success, :code:`True` is returned.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#answershippingquery
|
||||
|
||||
:param shipping_query_id: Unique identifier for the query to be answered
|
||||
:param ok: 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)
|
||||
:param shipping_options: Required if *ok* is :code:`True`. A JSON-serialized array of available shipping options.
|
||||
|
|
@ -553,6 +563,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to set the result of an interaction with a `Web App <https://core.telegram.org/bots/webapps>`_ and send a corresponding message on behalf of the user to the chat from which the query originated. On success, a :class:`aiogram.types.sent_web_app_message.SentWebAppMessage` object is returned.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#answerwebappquery
|
||||
|
||||
:param web_app_query_id: Unique identifier for the query to be answered
|
||||
:param result: A JSON-serialized object describing the message to be sent
|
||||
:param request_timeout: Request timeout
|
||||
|
|
@ -574,6 +586,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to approve a chat join request. The bot must be an administrator in the chat for this to work and must have the *can_invite_users* administrator right. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#approvechatjoinrequest
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param user_id: Unique identifier of the target user
|
||||
:param request_timeout: Request timeout
|
||||
|
|
@ -597,6 +611,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless `unbanned <https://core.telegram.org/bots/api#unbanchatmember>`_ first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#banchatmember
|
||||
|
||||
:param chat_id: Unique identifier for the target group or username of the target supergroup or channel (in the format :code:`@channelusername`)
|
||||
:param user_id: Unique identifier of the target user
|
||||
:param until_date: 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.
|
||||
|
|
@ -622,6 +638,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to ban a channel chat in a supergroup or a channel. Until the chat is `unbanned <https://core.telegram.org/bots/api#unbanchatsenderchat>`_, the owner of the banned chat won't be able to send messages on behalf of **any of their channels**. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#banchatsenderchat
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param sender_chat_id: Unique identifier of the target sender chat
|
||||
:param request_timeout: Request timeout
|
||||
|
|
@ -641,6 +659,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched. Returns :code:`True` on success. Requires no parameters.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#close
|
||||
|
||||
:param request_timeout: Request timeout
|
||||
:return: Requires no parameters.
|
||||
"""
|
||||
|
|
@ -657,6 +677,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to close an open 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.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#closeforumtopic
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)
|
||||
:param message_thread_id: Unique identifier for the target message thread of the forum topic
|
||||
:param request_timeout: Request timeout
|
||||
|
|
@ -690,6 +712,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to copy messages of any kind. Service messages and invoice messages can't be copied. A quiz :class:`aiogram.methods.poll.Poll` can be copied only if the value of the field *correct_option_id* is known to the bot. The method is analogous to the method :class:`aiogram.methods.forward_message.ForwardMessage`, but the copied message doesn't have a link to the original message. Returns the :class:`aiogram.types.message_id.MessageId` of the sent message on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#copymessage
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param from_chat_id: Unique identifier for the chat where the original message was sent (or channel username in the format :code:`@channelusername`)
|
||||
:param message_id: Message identifier in the chat specified in *from_chat_id*
|
||||
|
|
@ -734,6 +758,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the method :class:`aiogram.methods.revoke_chat_invite_link.RevokeChatInviteLink`. Returns the new invite link as :class:`aiogram.types.chat_invite_link.ChatInviteLink` object.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#createchatinvitelink
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param name: Invite link name; 0-32 characters
|
||||
:param expire_date: Point in time (Unix timestamp) when the link will expire
|
||||
|
|
@ -763,6 +789,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to create 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. Returns information about the created topic as a :class:`aiogram.types.forum_topic.ForumTopic` object.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#createforumtopic
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)
|
||||
:param name: Topic name, 1-128 characters
|
||||
:param icon_color: 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)
|
||||
|
|
@ -806,6 +834,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to create a link for an invoice. Returns the created invoice link as *String* on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#createinvoicelink
|
||||
|
||||
:param title: Product name, 1-32 characters
|
||||
:param description: Product description, 1-255 characters
|
||||
:param payload: Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.
|
||||
|
|
@ -870,6 +900,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. You **must** use exactly one of the fields *png_sticker*, *tgs_sticker*, or *webm_sticker*. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#createnewstickerset
|
||||
|
||||
:param user_id: User identifier of created sticker set owner
|
||||
:param name: Short name of sticker set, to be used in :code:`t.me/addstickers/` URLs (e.g., *animals*). Can contain only English letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in :code:`"_by_<bot_username>"`. :code:`<bot_username>` is case insensitive. 1-64 characters.
|
||||
:param title: Sticker set title, 1-64 characters
|
||||
|
|
@ -905,6 +937,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to decline a chat join request. The bot must be an administrator in the chat for this to work and must have the *can_invite_users* administrator right. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#declinechatjoinrequest
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param user_id: Unique identifier of the target user
|
||||
:param request_timeout: Request timeout
|
||||
|
|
@ -925,6 +959,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#deletechatphoto
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :code:`True` on success.
|
||||
|
|
@ -943,6 +979,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field *can_set_sticker_set* optionally returned in :class:`aiogram.methods.get_chat.GetChat` requests to check if the bot can use this method. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#deletechatstickerset
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :code:`True` on success.
|
||||
|
|
@ -962,6 +1000,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
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.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#deleteforumtopic
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)
|
||||
:param message_thread_id: Unique identifier for the target message thread of the forum topic
|
||||
:param request_timeout: Request timeout
|
||||
|
|
@ -1001,6 +1041,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
|
||||
Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#deletemessage
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param message_id: Identifier of the message to delete
|
||||
:param request_timeout: Request timeout
|
||||
|
|
@ -1022,6 +1064,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to delete the list of the bot's commands for the given scope and user language. After deletion, `higher level commands <https://core.telegram.org/bots/api#determining-list-of-commands>`_ will be shown to affected users. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#deletemycommands
|
||||
|
||||
:param scope: A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to :class:`aiogram.types.bot_command_scope_default.BotCommandScopeDefault`.
|
||||
:param language_code: 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
|
||||
:param request_timeout: Request timeout
|
||||
|
|
@ -1042,6 +1086,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to delete a sticker from a set created by the bot. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#deletestickerfromset
|
||||
|
||||
:param sticker: File identifier of the sticker
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :code:`True` on success.
|
||||
|
|
@ -1060,6 +1106,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to remove webhook integration if you decide to switch back to :class:`aiogram.methods.get_updates.GetUpdates`. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#deletewebhook
|
||||
|
||||
:param drop_pending_updates: Pass :code:`True` to drop all pending updates
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :code:`True` on success.
|
||||
|
|
@ -1083,6 +1131,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the edited invite link as a :class:`aiogram.types.chat_invite_link.ChatInviteLink` object.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#editchatinvitelink
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param invite_link: The invite link to edit
|
||||
:param name: Invite link name; 0-32 characters
|
||||
|
|
@ -1114,6 +1164,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
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 *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
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)
|
||||
:param message_thread_id: Unique identifier for the target message thread of the forum topic
|
||||
:param name: New topic name, 0-128 characters. If not specified or empty, the current name of the topic will be kept
|
||||
|
|
@ -1144,6 +1196,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
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.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#editmessagecaption
|
||||
|
||||
:param chat_id: 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`)
|
||||
:param message_id: Required if *inline_message_id* is not specified. Identifier of the message to edit
|
||||
:param inline_message_id: Required if *chat_id* and *message_id* are not specified. Identifier of the inline message
|
||||
|
|
@ -1182,6 +1236,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
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
|
||||
|
||||
:param latitude: Latitude of new location
|
||||
:param longitude: Longitude of new location
|
||||
:param chat_id: 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`)
|
||||
|
|
@ -1220,6 +1276,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to edit animation, audio, document, photo, or video 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.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#editmessagemedia
|
||||
|
||||
:param media: A JSON-serialized object for a new media content of the message
|
||||
:param chat_id: 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`)
|
||||
:param message_id: Required if *inline_message_id* is not specified. Identifier of the message to edit
|
||||
|
|
@ -1249,6 +1307,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to edit only the reply markup 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.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#editmessagereplymarkup
|
||||
|
||||
:param chat_id: 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`)
|
||||
:param message_id: Required if *inline_message_id* is not specified. Identifier of the message to edit
|
||||
:param inline_message_id: Required if *chat_id* and *message_id* are not specified. Identifier of the inline message
|
||||
|
|
@ -1280,6 +1340,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to edit text and `game <https://core.telegram.org/bots/api#games>`_ 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.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#editmessagetext
|
||||
|
||||
:param text: New text of the message, 1-4096 characters after entities parsing
|
||||
:param chat_id: 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`)
|
||||
:param message_id: Required if *inline_message_id* is not specified. Identifier of the message to edit
|
||||
|
|
@ -1314,6 +1376,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
|
||||
Note: Each administrator in a chat generates their own invite links. Bots can't use invite links generated by other administrators. If you want your bot to work with invite links, it will need to generate its own link using :class:`aiogram.methods.export_chat_invite_link.ExportChatInviteLink` or by calling the :class:`aiogram.methods.get_chat.GetChat` method. If your bot needs to generate a new primary invite link replacing its previous one, use :class:`aiogram.methods.export_chat_invite_link.ExportChatInviteLink` again.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#exportchatinvitelink
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param request_timeout: Request timeout
|
||||
:return: If your bot needs to generate a new primary invite link replacing its previous one, use :class:`aiogram.methods.export_chat_invite_link.ExportChatInviteLink` again.
|
||||
|
|
@ -1337,6 +1401,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to forward messages of any kind. Service messages can't be forwarded. On success, the sent :class:`aiogram.types.message.Message` is returned.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#forwardmessage
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param from_chat_id: Unique identifier for the chat where the original message was sent (or channel username in the format :code:`@channelusername`)
|
||||
:param message_id: Message identifier in the chat specified in *from_chat_id*
|
||||
|
|
@ -1365,6 +1431,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a :class:`aiogram.types.chat.Chat` object on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#getchat
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target supergroup or channel (in the format :code:`@channelusername`)
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns a :class:`aiogram.types.chat.Chat` object on success.
|
||||
|
|
@ -1392,6 +1460,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to get a list of administrators in a chat, which aren't bots. Returns an Array of :class:`aiogram.types.chat_member.ChatMember` objects.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#getchatadministrators
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target supergroup or channel (in the format :code:`@channelusername`)
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns an Array of :class:`aiogram.types.chat_member.ChatMember` objects.
|
||||
|
|
@ -1416,7 +1486,9 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
ChatMemberBanned,
|
||||
]:
|
||||
"""
|
||||
Use this method to get information about a member of a chat. The method is guaranteed to work for other users, only if the bot is an administrator in the chat. Returns a :class:`aiogram.types.chat_member.ChatMember` object on success.
|
||||
Use this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat. Returns a :class:`aiogram.types.chat_member.ChatMember` object on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#getchatmember
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target supergroup or channel (in the format :code:`@channelusername`)
|
||||
:param user_id: Unique identifier of the target user
|
||||
|
|
@ -1438,6 +1510,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to get the number of members in a chat. Returns *Int* on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#getchatmembercount
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target supergroup or channel (in the format :code:`@channelusername`)
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns *Int* on success.
|
||||
|
|
@ -1456,6 +1530,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns :class:`aiogram.types.menu_button.MenuButton` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#getchatmenubutton
|
||||
|
||||
:param chat_id: Unique identifier for the target private chat. If not specified, default bot's menu button will be returned
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :class:`aiogram.types.menu_button.MenuButton` on success.
|
||||
|
|
@ -1474,6 +1550,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to get information about custom emoji stickers by their identifiers. Returns an Array of :class:`aiogram.types.sticker.Sticker` objects.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#getcustomemojistickers
|
||||
|
||||
:param custom_emoji_ids: List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns an Array of :class:`aiogram.types.sticker.Sticker` objects.
|
||||
|
|
@ -1493,6 +1571,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
Use this method to get basic information about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a :class:`aiogram.types.file.File` object is returned. The file can then be downloaded via the link :code:`https://api.telegram.org/file/bot<token>/<file_path>`, where :code:`<file_path>` is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling :class:`aiogram.methods.get_file.GetFile` again.
|
||||
**Note:** This function may not preserve the original file name and MIME type. You should save the file's MIME type and name (if available) when the File object is received.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#getfile
|
||||
|
||||
:param file_id: File identifier to get information about
|
||||
:param request_timeout: Request timeout
|
||||
:return: You should save the file's MIME type and name (if available) when the File object is received.
|
||||
|
|
@ -1510,6 +1590,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user. Requires no parameters. Returns an Array of :class:`aiogram.types.sticker.Sticker` objects.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#getforumtopiciconstickers
|
||||
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns an Array of :class:`aiogram.types.sticker.Sticker` objects.
|
||||
"""
|
||||
|
|
@ -1530,6 +1612,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
|
||||
This method will currently return scores for the target user, plus two of their closest neighbors on each side. Will also return the top three users if the user and their neighbors are not among them. Please note that this behavior is subject to change.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#getgamehighscores
|
||||
|
||||
:param user_id: Target user id
|
||||
:param chat_id: Required if *inline_message_id* is not specified. Unique identifier for the target chat
|
||||
:param message_id: Required if *inline_message_id* is not specified. Identifier of the sent message
|
||||
|
|
@ -1553,6 +1637,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
A simple method for testing your bot's authentication token. Requires no parameters. Returns basic information about the bot in form of a :class:`aiogram.types.user.User` object.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#getme
|
||||
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns basic information about the bot in form of a :class:`aiogram.types.user.User` object.
|
||||
"""
|
||||
|
|
@ -1569,6 +1655,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to get the current list of the bot's commands for the given scope and user language. Returns an Array of :class:`aiogram.types.bot_command.BotCommand` objects. If commands aren't set, an empty list is returned.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#getmycommands
|
||||
|
||||
:param scope: A JSON-serialized object, describing scope of users. Defaults to :class:`aiogram.types.bot_command_scope_default.BotCommandScopeDefault`.
|
||||
:param language_code: A two-letter ISO 639-1 language code or an empty string
|
||||
:param request_timeout: Request timeout
|
||||
|
|
@ -1589,6 +1677,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to get the current default administrator rights of the bot. Returns :class:`aiogram.types.chat_administrator_rights.ChatAdministratorRights` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#getmydefaultadministratorrights
|
||||
|
||||
:param for_channels: Pass :code:`True` to get default administrator rights of the bot in channels. Otherwise, default administrator rights of the bot for groups and supergroups will be returned.
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :class:`aiogram.types.chat_administrator_rights.ChatAdministratorRights` on success.
|
||||
|
|
@ -1607,6 +1697,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to get a sticker set. On success, a :class:`aiogram.types.sticker_set.StickerSet` object is returned.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#getstickerset
|
||||
|
||||
:param name: Name of the sticker set
|
||||
:param request_timeout: Request timeout
|
||||
:return: On success, a :class:`aiogram.types.sticker_set.StickerSet` object is returned.
|
||||
|
|
@ -1634,6 +1726,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
|
||||
**2.** In order to avoid getting duplicate updates, recalculate *offset* after each server response.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#getupdates
|
||||
|
||||
:param offset: Identifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as :class:`aiogram.methods.get_updates.GetUpdates` is called with an *offset* higher than its *update_id*. The negative offset can be specified to retrieve updates starting from *-offset* update from the end of the updates queue. All previous updates will forgotten.
|
||||
:param limit: Limits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100.
|
||||
:param timeout: Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only.
|
||||
|
|
@ -1660,6 +1754,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to get a list of profile pictures for a user. Returns a :class:`aiogram.types.user_profile_photos.UserProfilePhotos` object.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#getuserprofilephotos
|
||||
|
||||
:param user_id: Unique identifier of the target user
|
||||
:param offset: Sequential number of the first photo to be returned. By default, all photos are returned.
|
||||
:param limit: Limits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100.
|
||||
|
|
@ -1681,6 +1777,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to get current webhook status. Requires no parameters. On success, returns a :class:`aiogram.types.webhook_info.WebhookInfo` object. If the bot is using :class:`aiogram.methods.get_updates.GetUpdates`, will return an object with the *url* field empty.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#getwebhookinfo
|
||||
|
||||
:param request_timeout: Request timeout
|
||||
:return: If the bot is using :class:`aiogram.methods.get_updates.GetUpdates`, will return an object with the *url* field empty.
|
||||
"""
|
||||
|
|
@ -1696,6 +1794,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method for your bot to leave a group, supergroup or channel. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#leavechat
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target supergroup or channel (in the format :code:`@channelusername`)
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :code:`True` on success.
|
||||
|
|
@ -1713,6 +1813,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to log out from the cloud Bot API server before launching the bot locally. You **must** log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates. After a successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns :code:`True` on success. Requires no parameters.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#logout
|
||||
|
||||
:param request_timeout: Request timeout
|
||||
:return: Requires no parameters.
|
||||
"""
|
||||
|
|
@ -1730,6 +1832,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#pinchatmessage
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param message_id: Identifier of a message to pin
|
||||
:param disable_notification: Pass :code:`True` if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats.
|
||||
|
|
@ -1765,6 +1869,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Pass :code:`False` for all boolean parameters to demote a user. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#promotechatmember
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param user_id: Unique identifier of the target user
|
||||
:param is_anonymous: Pass :code:`True` if the administrator's presence in the chat is hidden
|
||||
|
|
@ -1774,7 +1880,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
:param can_delete_messages: Pass :code:`True` if the administrator can delete messages of other users
|
||||
:param can_manage_video_chats: Pass :code:`True` if the administrator can manage video chats
|
||||
:param can_restrict_members: Pass :code:`True` if the administrator can restrict, ban or unban chat members
|
||||
:param can_promote_members: Pass :code:`True` if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him)
|
||||
:param can_promote_members: Pass :code:`True` if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him)
|
||||
:param can_change_info: Pass :code:`True` if the administrator can change chat title, photo and other settings
|
||||
:param can_invite_users: Pass :code:`True` if the administrator can invite new users to the chat
|
||||
:param can_pin_messages: Pass :code:`True` if the administrator can pin messages, supergroups only
|
||||
|
|
@ -1810,6 +1916,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to reopen a closed 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.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#reopenforumtopic
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)
|
||||
:param message_thread_id: Unique identifier for the target message thread of the forum topic
|
||||
:param request_timeout: Request timeout
|
||||
|
|
@ -1827,15 +1935,19 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
chat_id: Union[int, str],
|
||||
user_id: int,
|
||||
permissions: ChatPermissions,
|
||||
use_independent_chat_permissions: Optional[bool] = None,
|
||||
until_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> bool:
|
||||
"""
|
||||
Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass :code:`True` for all permissions to lift restrictions from a user. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#restrictchatmember
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)
|
||||
:param user_id: Unique identifier of the target user
|
||||
:param permissions: A JSON-serialized object for new user permissions
|
||||
:param use_independent_chat_permissions: Pass :code:`True` if chat permissions are set independently. Otherwise, the *can_send_other_messages* and *can_add_web_page_previews* permissions will imply the *can_send_messages*, *can_send_audios*, *can_send_documents*, *can_send_photos*, *can_send_videos*, *can_send_video_notes*, and *can_send_voice_notes* permissions; the *can_send_polls* permission will imply the *can_send_messages* permission.
|
||||
:param until_date: Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :code:`True` on success.
|
||||
|
|
@ -1845,6 +1957,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
chat_id=chat_id,
|
||||
user_id=user_id,
|
||||
permissions=permissions,
|
||||
use_independent_chat_permissions=use_independent_chat_permissions,
|
||||
until_date=until_date,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
|
@ -1858,6 +1971,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the revoked invite link as :class:`aiogram.types.chat_invite_link.ChatInviteLink` object.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#revokechatinvitelink
|
||||
|
||||
:param chat_id: Unique identifier of the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param invite_link: The invite link to revoke
|
||||
:param request_timeout: Request timeout
|
||||
|
|
@ -1895,6 +2010,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#sendanimation
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param animation: Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
|
|
@ -1960,6 +2077,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.
|
||||
For sending voice messages, use the :class:`aiogram.methods.send_voice.SendVoice` method instead.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#sendaudio
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param audio: Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
|
|
@ -2012,6 +2131,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
|
||||
We only recommend using this method when a response from the bot will take a **noticeable** amount of time to arrive.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#sendchataction
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param action: Type of action to broadcast. Choose one, depending on what the user is about to receive: *typing* for `text messages <https://core.telegram.org/bots/api#sendmessage>`_, *upload_photo* for `photos <https://core.telegram.org/bots/api#sendphoto>`_, *record_video* or *upload_video* for `videos <https://core.telegram.org/bots/api#sendvideo>`_, *record_voice* or *upload_voice* for `voice notes <https://core.telegram.org/bots/api#sendvoice>`_, *upload_document* for `general files <https://core.telegram.org/bots/api#senddocument>`_, *choose_sticker* for `stickers <https://core.telegram.org/bots/api#sendsticker>`_, *find_location* for `location data <https://core.telegram.org/bots/api#sendlocation>`_, *record_video_note* or *upload_video_note* for `video notes <https://core.telegram.org/bots/api#sendvideonote>`_.
|
||||
:param message_thread_id: Unique identifier for the target message thread; supergroups only
|
||||
|
|
@ -2046,6 +2167,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to send phone contacts. On success, the sent :class:`aiogram.types.message.Message` is returned.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#sendcontact
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param phone_number: Contact's phone number
|
||||
:param first_name: Contact's first name
|
||||
|
|
@ -2093,6 +2216,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to send an animated emoji that will display a random value. On success, the sent :class:`aiogram.types.message.Message` is returned.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#senddice
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
:param emoji: Emoji on which the dice throw animation is based. Currently, must be one of '🎲', '🎯', '🏀', '⚽', '🎳', or '🎰'. Dice can have values 1-6 for '🎲', '🎯' and '🎳', values 1-5 for '🏀' and '⚽', and values 1-64 for '🎰'. Defaults to '🎲'
|
||||
|
|
@ -2139,6 +2264,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to send general files. On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#senddocument
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param document: File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
|
|
@ -2188,6 +2315,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to send a game. On success, the sent :class:`aiogram.types.message.Message` is returned.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#sendgame
|
||||
|
||||
:param chat_id: Unique identifier for the target chat
|
||||
:param game_short_name: Short name of the game, serves as the unique identifier for the game. Set up your games via `@BotFather <https://t.me/botfather>`_.
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
|
|
@ -2247,6 +2376,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to send invoices. On success, the sent :class:`aiogram.types.message.Message` is returned.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#sendinvoice
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param title: Product name, 1-32 characters
|
||||
:param description: Product description, 1-255 characters
|
||||
|
|
@ -2333,6 +2464,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to send point on the map. On success, the sent :class:`aiogram.types.message.Message` is returned.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#sendlocation
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param latitude: Latitude of the location
|
||||
:param longitude: Longitude of the location
|
||||
|
|
@ -2381,6 +2514,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to send a group of photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of `Messages <https://core.telegram.org/bots/api#message>`_ that were sent is returned.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#sendmediagroup
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param media: A JSON-serialized array describing messages to be sent, must include 2-10 items
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
|
|
@ -2423,6 +2558,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to send text messages. On success, the sent :class:`aiogram.types.message.Message` is returned.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#sendmessage
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param text: Text of the message to be sent, 1-4096 characters after entities parsing
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
|
|
@ -2474,6 +2611,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to send photos. On success, the sent :class:`aiogram.types.message.Message` is returned.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#sendphoto
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param photo: Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. :ref:`More information on Sending Files » <sending-files>`
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
|
|
@ -2534,6 +2673,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to send a native poll. On success, the sent :class:`aiogram.types.message.Message` is returned.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#sendpoll
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param question: Poll question, 1-300 characters
|
||||
:param options: A JSON-serialized list of answer options, 2-10 strings 1-100 characters each
|
||||
|
|
@ -2597,6 +2738,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to send static .WEBP, `animated <https://telegram.org/blog/animated-stickers>`_ .TGS, or `video <https://telegram.org/blog/video-stickers-better-reactions>`_ .WEBM stickers. On success, the sent :class:`aiogram.types.message.Message` is returned.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#sendsticker
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param sticker: Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
|
|
@ -2645,6 +2788,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to send information about a venue. On success, the sent :class:`aiogram.types.message.Message` is returned.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#sendvenue
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param latitude: Latitude of the venue
|
||||
:param longitude: Longitude of the venue
|
||||
|
|
@ -2709,6 +2854,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#sendvideo
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param video: Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
|
|
@ -2771,6 +2918,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
As of `v.4.0 <https://telegram.org/blog/video-messages-and-telescope>`_, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent :class:`aiogram.types.message.Message` is returned.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#sendvideonote
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param video_note: Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`. Sending video notes by a URL is currently unsupported
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
|
|
@ -2822,6 +2971,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as :class:`aiogram.types.audio.Audio` or :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#sendvoice
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param voice: Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
|
|
@ -2864,6 +3015,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setchatadministratorcustomtitle
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)
|
||||
:param user_id: Unique identifier of the target user
|
||||
:param custom_title: New custom title for the administrator; 0-16 characters, emoji are not allowed
|
||||
|
|
@ -2887,6 +3040,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setchatdescription
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param description: New chat description, 0-255 characters
|
||||
:param request_timeout: Request timeout
|
||||
|
|
@ -2910,6 +3065,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to change the bot's menu button in a private chat, or the default menu button. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setchatmenubutton
|
||||
|
||||
:param chat_id: Unique identifier for the target private chat. If not specified, default bot's menu button will be changed
|
||||
:param menu_button: A JSON-serialized object for the bot's new menu button. Defaults to :class:`aiogram.types.menu_button_default.MenuButtonDefault`
|
||||
:param request_timeout: Request timeout
|
||||
|
|
@ -2926,13 +3083,17 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
self,
|
||||
chat_id: Union[int, str],
|
||||
permissions: ChatPermissions,
|
||||
use_independent_chat_permissions: Optional[bool] = None,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> bool:
|
||||
"""
|
||||
Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the *can_restrict_members* administrator rights. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setchatpermissions
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)
|
||||
:param permissions: A JSON-serialized object for new default chat permissions
|
||||
:param use_independent_chat_permissions: Pass :code:`True` if chat permissions are set independently. Otherwise, the *can_send_other_messages* and *can_add_web_page_previews* permissions will imply the *can_send_messages*, *can_send_audios*, *can_send_documents*, *can_send_photos*, *can_send_videos*, *can_send_video_notes*, and *can_send_voice_notes* permissions; the *can_send_polls* permission will imply the *can_send_messages* permission.
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :code:`True` on success.
|
||||
"""
|
||||
|
|
@ -2940,6 +3101,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
call = SetChatPermissions(
|
||||
chat_id=chat_id,
|
||||
permissions=permissions,
|
||||
use_independent_chat_permissions=use_independent_chat_permissions,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
|
|
@ -2952,6 +3114,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setchatphoto
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param photo: New chat photo, uploaded using multipart/form-data
|
||||
:param request_timeout: Request timeout
|
||||
|
|
@ -2973,6 +3137,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field *can_set_sticker_set* optionally returned in :class:`aiogram.methods.get_chat.GetChat` requests to check if the bot can use this method. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setchatstickerset
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)
|
||||
:param sticker_set_name: Name of the sticker set to be set as the group sticker set
|
||||
:param request_timeout: Request timeout
|
||||
|
|
@ -2994,6 +3160,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setchattitle
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param title: New chat title, 1-128 characters
|
||||
:param request_timeout: Request timeout
|
||||
|
|
@ -3020,6 +3188,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to set the score of the specified user in a game message. On success, if the message is not an inline message, the :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Returns an error, if the new score is not greater than the user's current score in the chat and *force* is :code:`False`.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setgamescore
|
||||
|
||||
:param user_id: User identifier
|
||||
:param score: New score, must be non-negative
|
||||
:param force: Pass :code:`True` if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters
|
||||
|
|
@ -3052,6 +3222,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to change the list of the bot's commands. See `this manual <https://core.telegram.org/bots/features#commands>`_ for more details about bot commands. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setmycommands
|
||||
|
||||
:param commands: A JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified.
|
||||
:param scope: A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to :class:`aiogram.types.bot_command_scope_default.BotCommandScopeDefault`.
|
||||
:param language_code: 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
|
||||
|
|
@ -3075,6 +3247,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are are free to modify the list before adding the bot. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setmydefaultadministratorrights
|
||||
|
||||
:param rights: A JSON-serialized object describing new default administrator rights. If not specified, the default administrator rights will be cleared.
|
||||
:param for_channels: Pass :code:`True` to change the default administrator rights of the bot in channels. Otherwise, the default administrator rights of the bot for groups and supergroups will be changed.
|
||||
:param request_timeout: Request timeout
|
||||
|
|
@ -3097,6 +3271,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns :code:`True` on success.
|
||||
Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setpassportdataerrors
|
||||
|
||||
:param user_id: User identifier
|
||||
:param errors: A JSON-serialized array describing the errors
|
||||
:param request_timeout: Request timeout
|
||||
|
|
@ -3118,6 +3294,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to move a sticker in a set created by the bot to a specific position. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setstickerpositioninset
|
||||
|
||||
:param sticker: File identifier of the sticker
|
||||
:param position: New sticker position in the set, zero-based
|
||||
:param request_timeout: Request timeout
|
||||
|
|
@ -3140,6 +3318,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to set the thumbnail of a sticker set. Animated thumbnails can be set for animated sticker sets only. Video thumbnails can be set only for video sticker sets only. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setstickersetthumb
|
||||
|
||||
:param name: Sticker set name
|
||||
:param user_id: User identifier of the sticker set owner
|
||||
:param thumb: A **PNG** image with the thumbnail, must be up to 128 kilobytes in size and have width and height exactly 100px, or a **TGS** animation with the thumbnail up to 32 kilobytes in size; see `https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_`https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_ for animated sticker technical requirements, or a **WEBM** video with the thumbnail up to 32 kilobytes in size; see `https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_`https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_ for video sticker technical requirements. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`. Animated sticker set thumbnails can't be uploaded via HTTP URL.
|
||||
|
|
@ -3178,6 +3358,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
**3.** Ports currently supported *for webhooks*: **443, 80, 88, 8443**.
|
||||
If you're having any trouble setting up webhooks, please check out this `amazing guide to webhooks <https://core.telegram.org/bots/webhooks>`_.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setwebhook
|
||||
|
||||
:param url: HTTPS URL to send updates to. Use an empty string to remove webhook integration
|
||||
:param certificate: Upload your public key certificate so that the root certificate in use can be checked. See our `self-signed guide <https://core.telegram.org/bots/self-signed>`_ for details.
|
||||
:param ip_address: The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS
|
||||
|
|
@ -3211,6 +3393,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to stop updating a live location message before *live_period* expires. On success, if the 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#stopmessagelivelocation
|
||||
|
||||
:param chat_id: 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`)
|
||||
:param message_id: Required if *inline_message_id* is not specified. Identifier of the message with live location to stop
|
||||
:param inline_message_id: Required if *chat_id* and *message_id* are not specified. Identifier of the inline message
|
||||
|
|
@ -3237,6 +3421,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to stop a poll which was sent by the bot. On success, the stopped :class:`aiogram.types.poll.Poll` is returned.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#stoppoll
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param message_id: Identifier of the original message with the poll
|
||||
:param reply_markup: A JSON-serialized object for a new message `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_.
|
||||
|
|
@ -3261,6 +3447,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to unban a previously banned user in a supergroup or channel. The user will **not** return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be **removed** from the chat. If you don't want this, use the parameter *only_if_banned*. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#unbanchatmember
|
||||
|
||||
:param chat_id: Unique identifier for the target group or username of the target supergroup or channel (in the format :code:`@channelusername`)
|
||||
:param user_id: Unique identifier of the target user
|
||||
:param only_if_banned: Do nothing if the user is not banned
|
||||
|
|
@ -3284,6 +3472,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#unbanchatsenderchat
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param sender_chat_id: Unique identifier of the target sender chat
|
||||
:param request_timeout: Request timeout
|
||||
|
|
@ -3304,6 +3494,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#unpinallchatmessages
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :code:`True` on success.
|
||||
|
|
@ -3323,6 +3515,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
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.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#unpinallforumtopicmessages
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)
|
||||
:param message_thread_id: Unique identifier for the target message thread of the forum topic
|
||||
:param request_timeout: Request timeout
|
||||
|
|
@ -3344,6 +3538,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#unpinchatmessage
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param message_id: Identifier of a message to unpin. If not specified, the most recent pinned message (by sending date) will be unpinned.
|
||||
:param request_timeout: Request timeout
|
||||
|
|
@ -3365,6 +3561,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to upload a .PNG file with a sticker for later use in *createNewStickerSet* and *addStickerToSet* methods (can be used multiple times). Returns the uploaded :class:`aiogram.types.file.File` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#uploadstickerfile
|
||||
|
||||
:param user_id: User identifier of sticker file owner
|
||||
:param png_sticker: **PNG** image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. :ref:`More information on Sending Files » <sending-files>`
|
||||
:param request_timeout: Request timeout
|
||||
|
|
@ -3385,6 +3583,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to close an open 'General' 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. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#closegeneralforumtopic
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :code:`True` on success.
|
||||
|
|
@ -3404,6 +3604,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have *can_manage_topics* administrator rights. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#editgeneralforumtopic
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)
|
||||
:param name: New topic name, 1-128 characters
|
||||
:param request_timeout: Request timeout
|
||||
|
|
@ -3424,6 +3626,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to hide the 'General' 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. The topic will be automatically closed if it was open. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#hidegeneralforumtopic
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :code:`True` on success.
|
||||
|
|
@ -3442,6 +3646,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to reopen a closed 'General' 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. The topic will be automatically unhidden if it was hidden. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#reopengeneralforumtopic
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :code:`True` on success.
|
||||
|
|
@ -3460,6 +3666,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
Use this method to unhide the 'General' 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. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#unhidegeneralforumtopic
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :code:`True` on success.
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@ class ContentType(str, Enum):
|
|||
PINNED_MESSAGE = "pinned_message"
|
||||
INVOICE = "invoice"
|
||||
SUCCESSFUL_PAYMENT = "successful_payment"
|
||||
USER_SHARED = "user_shared"
|
||||
CHAT_SHARED = "chat_shared"
|
||||
CONNECTED_WEBSITE = "connected_website"
|
||||
WRITE_ACCESS_ALLOWED = "write_access_allowed"
|
||||
PASSPORT_DATA = "passport_data"
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class GetChatMember(
|
|||
]
|
||||
):
|
||||
"""
|
||||
Use this method to get information about a member of a chat. The method is guaranteed to work for other users, only if the bot is an administrator in the chat. Returns a :class:`aiogram.types.chat_member.ChatMember` object on success.
|
||||
Use this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat. Returns a :class:`aiogram.types.chat_member.ChatMember` object on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#getchatmember
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class PromoteChatMember(TelegramMethod[bool]):
|
|||
can_restrict_members: Optional[bool] = None
|
||||
"""Pass :code:`True` if the administrator can restrict, ban or unban chat members"""
|
||||
can_promote_members: Optional[bool] = None
|
||||
"""Pass :code:`True` if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him)"""
|
||||
"""Pass :code:`True` if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him)"""
|
||||
can_change_info: Optional[bool] = None
|
||||
"""Pass :code:`True` if the administrator can change chat title, photo and other settings"""
|
||||
can_invite_users: Optional[bool] = None
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@ class RestrictChatMember(TelegramMethod[bool]):
|
|||
"""Unique identifier of the target user"""
|
||||
permissions: ChatPermissions
|
||||
"""A JSON-serialized object for new user permissions"""
|
||||
use_independent_chat_permissions: Optional[bool] = None
|
||||
"""Pass :code:`True` if chat permissions are set independently. Otherwise, the *can_send_other_messages* and *can_add_web_page_previews* permissions will imply the *can_send_messages*, *can_send_audios*, *can_send_documents*, *can_send_photos*, *can_send_videos*, *can_send_video_notes*, and *can_send_voice_notes* permissions; the *can_send_polls* permission will imply the *can_send_messages* permission."""
|
||||
until_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None
|
||||
"""Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever"""
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Dict, Union
|
||||
from typing import TYPE_CHECKING, Any, Dict, Optional, Union
|
||||
|
||||
from ..types import ChatPermissions
|
||||
from .base import Request, TelegramMethod
|
||||
|
|
@ -22,6 +22,8 @@ class SetChatPermissions(TelegramMethod[bool]):
|
|||
"""Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)"""
|
||||
permissions: ChatPermissions
|
||||
"""A JSON-serialized object for new default chat permissions"""
|
||||
use_independent_chat_permissions: Optional[bool] = None
|
||||
"""Pass :code:`True` if chat permissions are set independently. Otherwise, the *can_send_other_messages* and *can_add_web_page_previews* permissions will imply the *can_send_messages*, *can_send_audios*, *can_send_documents*, *can_send_photos*, *can_send_videos*, *can_send_video_notes*, and *can_send_voice_notes* permissions; the *can_send_polls* permission will imply the *can_send_messages* permission."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ from .chat_member_restricted import ChatMemberRestricted
|
|||
from .chat_member_updated import ChatMemberUpdated
|
||||
from .chat_permissions import ChatPermissions
|
||||
from .chat_photo import ChatPhoto
|
||||
from .chat_shared import ChatShared
|
||||
from .chosen_inline_result import ChosenInlineResult
|
||||
from .contact import Contact
|
||||
from .dice import Dice
|
||||
|
|
@ -90,6 +91,8 @@ from .input_venue_message_content import InputVenueMessageContent
|
|||
from .invoice import Invoice
|
||||
from .keyboard_button import KeyboardButton
|
||||
from .keyboard_button_poll_type import KeyboardButtonPollType
|
||||
from .keyboard_button_request_chat import KeyboardButtonRequestChat
|
||||
from .keyboard_button_request_user import KeyboardButtonRequestUser
|
||||
from .labeled_price import LabeledPrice
|
||||
from .location import Location
|
||||
from .login_url import LoginUrl
|
||||
|
|
@ -136,6 +139,7 @@ from .successful_payment import SuccessfulPayment
|
|||
from .update import Update
|
||||
from .user import User
|
||||
from .user_profile_photos import UserProfilePhotos
|
||||
from .user_shared import UserShared
|
||||
from .venue import Venue
|
||||
from .video import Video
|
||||
from .video_chat_ended import VideoChatEnded
|
||||
|
|
@ -179,6 +183,7 @@ __all__ = (
|
|||
"ChatMemberUpdated",
|
||||
"ChatPermissions",
|
||||
"ChatPhoto",
|
||||
"ChatShared",
|
||||
"ChosenInlineResult",
|
||||
"Contact",
|
||||
"ContentType",
|
||||
|
|
@ -240,6 +245,8 @@ __all__ = (
|
|||
"Invoice",
|
||||
"KeyboardButton",
|
||||
"KeyboardButtonPollType",
|
||||
"KeyboardButtonRequestChat",
|
||||
"KeyboardButtonRequestUser",
|
||||
"LabeledPrice",
|
||||
"Location",
|
||||
"LoginUrl",
|
||||
|
|
@ -287,6 +294,7 @@ __all__ = (
|
|||
"Update",
|
||||
"User",
|
||||
"UserProfilePhotos",
|
||||
"UserShared",
|
||||
"Venue",
|
||||
"Video",
|
||||
"VideoChatEnded",
|
||||
|
|
|
|||
|
|
@ -506,7 +506,7 @@ class Chat(TelegramObject):
|
|||
|
||||
- :code:`chat_id`
|
||||
|
||||
Use this method to get information about a member of a chat. The method is guaranteed to work for other users, only if the bot is an administrator in the chat. Returns a :class:`aiogram.types.chat_member.ChatMember` object on success.
|
||||
Use this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat. Returns a :class:`aiogram.types.chat_member.ChatMember` object on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#getchatmember
|
||||
|
||||
|
|
@ -698,6 +698,7 @@ class Chat(TelegramObject):
|
|||
def set_permissions(
|
||||
self,
|
||||
permissions: ChatPermissions,
|
||||
use_independent_chat_permissions: Optional[bool] = None,
|
||||
**kwargs: Any,
|
||||
) -> SetChatPermissions:
|
||||
"""
|
||||
|
|
@ -711,6 +712,7 @@ class Chat(TelegramObject):
|
|||
Source: https://core.telegram.org/bots/api#setchatpermissions
|
||||
|
||||
:param permissions: A JSON-serialized object for new default chat permissions
|
||||
:param use_independent_chat_permissions: Pass :code:`True` if chat permissions are set independently. Otherwise, the *can_send_other_messages* and *can_add_web_page_previews* permissions will imply the *can_send_messages*, *can_send_audios*, *can_send_documents*, *can_send_photos*, *can_send_videos*, *can_send_video_notes*, and *can_send_voice_notes* permissions; the *can_send_polls* permission will imply the *can_send_messages* permission.
|
||||
:return: instance of method :class:`aiogram.methods.set_chat_permissions.SetChatPermissions`
|
||||
"""
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
|
|
@ -721,6 +723,7 @@ class Chat(TelegramObject):
|
|||
return SetChatPermissions(
|
||||
chat_id=self.id,
|
||||
permissions=permissions,
|
||||
use_independent_chat_permissions=use_independent_chat_permissions,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
|
|
@ -759,7 +762,7 @@ class Chat(TelegramObject):
|
|||
:param can_delete_messages: Pass :code:`True` if the administrator can delete messages of other users
|
||||
:param can_manage_video_chats: Pass :code:`True` if the administrator can manage video chats
|
||||
:param can_restrict_members: Pass :code:`True` if the administrator can restrict, ban or unban chat members
|
||||
:param can_promote_members: Pass :code:`True` if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him)
|
||||
:param can_promote_members: Pass :code:`True` if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him)
|
||||
:param can_change_info: Pass :code:`True` if the administrator can change chat title, photo and other settings
|
||||
:param can_invite_users: Pass :code:`True` if the administrator can invite new users to the chat
|
||||
:param can_pin_messages: Pass :code:`True` if the administrator can pin messages, supergroups only
|
||||
|
|
@ -793,6 +796,7 @@ class Chat(TelegramObject):
|
|||
self,
|
||||
user_id: int,
|
||||
permissions: ChatPermissions,
|
||||
use_independent_chat_permissions: Optional[bool] = None,
|
||||
until_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None,
|
||||
**kwargs: Any,
|
||||
) -> RestrictChatMember:
|
||||
|
|
@ -808,6 +812,7 @@ class Chat(TelegramObject):
|
|||
|
||||
:param user_id: Unique identifier of the target user
|
||||
:param permissions: A JSON-serialized object for new user permissions
|
||||
:param use_independent_chat_permissions: Pass :code:`True` if chat permissions are set independently. Otherwise, the *can_send_other_messages* and *can_add_web_page_previews* permissions will imply the *can_send_messages*, *can_send_audios*, *can_send_documents*, *can_send_photos*, *can_send_videos*, *can_send_video_notes*, and *can_send_voice_notes* permissions; the *can_send_polls* permission will imply the *can_send_messages* permission.
|
||||
:param until_date: Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever
|
||||
:return: instance of method :class:`aiogram.methods.restrict_chat_member.RestrictChatMember`
|
||||
"""
|
||||
|
|
@ -820,6 +825,7 @@ class Chat(TelegramObject):
|
|||
chat_id=self.id,
|
||||
user_id=user_id,
|
||||
permissions=permissions,
|
||||
use_independent_chat_permissions=use_independent_chat_permissions,
|
||||
until_date=until_date,
|
||||
**kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class ChatAdministratorRights(TelegramObject):
|
|||
can_restrict_members: bool
|
||||
""":code:`True`, if the administrator can restrict, ban or unban chat members"""
|
||||
can_promote_members: bool
|
||||
""":code:`True`, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)"""
|
||||
""":code:`True`, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user)"""
|
||||
can_change_info: bool
|
||||
""":code:`True`, if the user is allowed to change the chat title, photo and other settings"""
|
||||
can_invite_users: bool
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ class ChatJoinRequest(TelegramObject):
|
|||
"""Chat to which the request was sent"""
|
||||
from_user: User = Field(..., alias="from")
|
||||
"""User that sent the join request"""
|
||||
user_chat_id: int
|
||||
"""Identifier of a private chat with the user who sent the join request. 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. The bot can use this identifier for 24 hours to send messages until the join request is processed, assuming no other administrator contacted the user."""
|
||||
date: datetime.datetime
|
||||
"""Date the request was sent in Unix time"""
|
||||
bio: Optional[str] = None
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class ChatMember(TelegramObject):
|
|||
can_restrict_members: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the administrator can restrict, ban or unban chat members"""
|
||||
can_promote_members: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)"""
|
||||
"""*Optional*. :code:`True`, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user)"""
|
||||
can_change_info: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to change the chat title, photo and other settings"""
|
||||
can_invite_users: Optional[bool] = None
|
||||
|
|
@ -58,9 +58,19 @@ class ChatMember(TelegramObject):
|
|||
is_member: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is a member of the chat at the moment of the request"""
|
||||
can_send_messages: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to send text messages, contacts, locations and venues"""
|
||||
can_send_media_messages: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes"""
|
||||
"""*Optional*. :code:`True`, if the user is allowed to send text messages, contacts, invoices, locations and venues"""
|
||||
can_send_audios: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to send audios"""
|
||||
can_send_documents: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to send documents"""
|
||||
can_send_photos: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to send photos"""
|
||||
can_send_videos: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to send videos"""
|
||||
can_send_video_notes: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to send video notes"""
|
||||
can_send_voice_notes: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to send voice notes"""
|
||||
can_send_polls: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to send polls"""
|
||||
can_send_other_messages: Optional[bool] = None
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class ChatMemberAdministrator(ChatMember):
|
|||
can_restrict_members: bool
|
||||
""":code:`True`, if the administrator can restrict, ban or unban chat members"""
|
||||
can_promote_members: bool
|
||||
""":code:`True`, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)"""
|
||||
""":code:`True`, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user)"""
|
||||
can_change_info: bool
|
||||
""":code:`True`, if the user is allowed to change the chat title, photo and other settings"""
|
||||
can_invite_users: bool
|
||||
|
|
|
|||
|
|
@ -25,6 +25,26 @@ class ChatMemberRestricted(ChatMember):
|
|||
"""Information about the user"""
|
||||
is_member: bool
|
||||
""":code:`True`, if the user is a member of the chat at the moment of the request"""
|
||||
can_send_messages: bool
|
||||
""":code:`True`, if the user is allowed to send text messages, contacts, invoices, locations and venues"""
|
||||
can_send_audios: bool
|
||||
""":code:`True`, if the user is allowed to send audios"""
|
||||
can_send_documents: bool
|
||||
""":code:`True`, if the user is allowed to send documents"""
|
||||
can_send_photos: bool
|
||||
""":code:`True`, if the user is allowed to send photos"""
|
||||
can_send_videos: bool
|
||||
""":code:`True`, if the user is allowed to send videos"""
|
||||
can_send_video_notes: bool
|
||||
""":code:`True`, if the user is allowed to send video notes"""
|
||||
can_send_voice_notes: bool
|
||||
""":code:`True`, if the user is allowed to send voice notes"""
|
||||
can_send_polls: bool
|
||||
""":code:`True`, if the user is allowed to send polls"""
|
||||
can_send_other_messages: bool
|
||||
""":code:`True`, if the user is allowed to send animations, games, stickers and use inline bots"""
|
||||
can_add_web_page_previews: bool
|
||||
""":code:`True`, if the user is allowed to add web page previews to their messages"""
|
||||
can_change_info: bool
|
||||
""":code:`True`, if the user is allowed to change the chat title, photo and other settings"""
|
||||
can_invite_users: bool
|
||||
|
|
@ -33,15 +53,5 @@ class ChatMemberRestricted(ChatMember):
|
|||
""":code:`True`, if the user is allowed to pin messages"""
|
||||
can_manage_topics: bool
|
||||
""":code:`True`, if the user is allowed to create forum topics"""
|
||||
can_send_messages: bool
|
||||
""":code:`True`, if the user is allowed to send text messages, contacts, locations and venues"""
|
||||
can_send_media_messages: bool
|
||||
""":code:`True`, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes"""
|
||||
can_send_polls: bool
|
||||
""":code:`True`, if the user is allowed to send polls"""
|
||||
can_send_other_messages: bool
|
||||
""":code:`True`, if the user is allowed to send animations, games, stickers and use inline bots"""
|
||||
can_add_web_page_previews: bool
|
||||
""":code:`True`, if the user is allowed to add web page previews to their messages"""
|
||||
until_date: datetime.datetime
|
||||
"""Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever"""
|
||||
|
|
|
|||
|
|
@ -13,15 +13,25 @@ class ChatPermissions(MutableTelegramObject):
|
|||
"""
|
||||
|
||||
can_send_messages: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to send text messages, contacts, locations and venues"""
|
||||
can_send_media_messages: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages"""
|
||||
"""*Optional*. :code:`True`, if the user is allowed to send text messages, contacts, invoices, locations and venues"""
|
||||
can_send_audios: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to send audios"""
|
||||
can_send_documents: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to send documents"""
|
||||
can_send_photos: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to send photos"""
|
||||
can_send_videos: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to send videos"""
|
||||
can_send_video_notes: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to send video notes"""
|
||||
can_send_voice_notes: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to send voice notes"""
|
||||
can_send_polls: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to send polls, implies can_send_messages"""
|
||||
"""*Optional*. :code:`True`, if the user is allowed to send polls"""
|
||||
can_send_other_messages: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages"""
|
||||
"""*Optional*. :code:`True`, if the user is allowed to send animations, games, stickers and use inline bots"""
|
||||
can_add_web_page_previews: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to add web page previews to their messages, implies can_send_media_messages"""
|
||||
"""*Optional*. :code:`True`, if the user is allowed to add web page previews to their messages"""
|
||||
can_change_info: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups"""
|
||||
can_invite_users: Optional[bool] = None
|
||||
|
|
|
|||
14
aiogram/types/chat_shared.py
Normal file
14
aiogram/types/chat_shared.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
from aiogram.types import TelegramObject
|
||||
|
||||
|
||||
class ChatShared(TelegramObject):
|
||||
"""
|
||||
This object contains information about the chat whose identifier was shared with the bot using a :class:`aiogram.types.keyboard_button_request_chat.KeyboardButtonRequestChat` button.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#chatshared
|
||||
"""
|
||||
|
||||
request_id: int
|
||||
"""Identifier of the request"""
|
||||
chat_id: int
|
||||
"""Identifier of the shared chat. 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. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means."""
|
||||
|
|
@ -6,23 +6,31 @@ from .base import MutableTelegramObject
|
|||
|
||||
if TYPE_CHECKING:
|
||||
from .keyboard_button_poll_type import KeyboardButtonPollType
|
||||
from .keyboard_button_request_chat import KeyboardButtonRequestChat
|
||||
from .keyboard_button_request_user import KeyboardButtonRequestUser
|
||||
from .web_app_info import WebAppInfo
|
||||
|
||||
|
||||
class KeyboardButton(MutableTelegramObject):
|
||||
"""
|
||||
This object represents one button of the reply keyboard. For simple text buttons *String* can be used instead of this object to specify text of the button. Optional fields *web_app*, *request_contact*, *request_location*, and *request_poll* are mutually exclusive.
|
||||
This object represents one button of the reply keyboard. For simple text buttons, *String* can be used instead of this object to specify the button text. The optional fields *web_app*, *request_user*, *request_chat*, *request_contact*, *request_location*, and *request_poll* are mutually exclusive.
|
||||
**Note:** *request_contact* and *request_location* options will only work in Telegram versions released after 9 April, 2016. Older clients will display *unsupported message*.
|
||||
|
||||
**Note:** *request_poll* option will only work in Telegram versions released after 23 January, 2020. Older clients will display *unsupported message*.
|
||||
|
||||
**Note:** *web_app* option will only work in Telegram versions released after 16 April, 2022. Older clients will display *unsupported message*.
|
||||
|
||||
**Note:** *request_user* and *request_chat* options will only work in Telegram versions released after 3 February, 2023. Older clients will display *unsupported message*.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#keyboardbutton
|
||||
"""
|
||||
|
||||
text: str
|
||||
"""Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed"""
|
||||
request_user: Optional[KeyboardButtonRequestUser] = None
|
||||
"""*Optional.* If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a 'user_shared' service message. Available in private chats only."""
|
||||
request_chat: Optional[KeyboardButtonRequestChat] = None
|
||||
"""*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."""
|
||||
request_contact: Optional[bool] = None
|
||||
"""*Optional*. If :code:`True`, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only."""
|
||||
request_location: Optional[bool] = None
|
||||
|
|
|
|||
33
aiogram/types/keyboard_button_request_chat.py
Normal file
33
aiogram/types/keyboard_button_request_chat.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from aiogram.types import TelegramObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .chat_administrator_rights import ChatAdministratorRights
|
||||
|
||||
|
||||
class KeyboardButtonRequestChat(TelegramObject):
|
||||
"""
|
||||
This object defines the criteria used to request a suitable chat. The identifier of the selected chat will be shared with the bot when the corresponding button is pressed.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#keyboardbuttonrequestchat
|
||||
"""
|
||||
|
||||
request_id: int
|
||||
"""Signed 32-bit identifier of the request, which will be received back in the :class:`aiogram.types.chat_shared.ChatShared` object. Must be unique within the message"""
|
||||
chat_is_channel: bool
|
||||
"""Pass :code:`True` to request a channel chat, pass :code:`False` to request a group or a supergroup chat."""
|
||||
chat_is_forum: Optional[bool] = None
|
||||
"""*Optional*. Pass :code:`True` to request a forum supergroup, pass :code:`False` to request a non-forum chat. If not specified, no additional restrictions are applied."""
|
||||
chat_has_username: Optional[bool] = None
|
||||
"""*Optional*. Pass :code:`True` to request a supergroup or a channel with a username, pass :code:`False` to request a chat without a username. If not specified, no additional restrictions are applied."""
|
||||
chat_is_created: Optional[bool] = None
|
||||
"""*Optional*. Pass :code:`True` to request a chat owned by the user. Otherwise, no additional restrictions are applied."""
|
||||
user_administrator_rights: Optional[ChatAdministratorRights] = None
|
||||
"""*Optional*. A JSON-serialized object listing the required administrator rights of the user in the chat. The rights must be a superset of *bot_administrator_rights*. If not specified, no additional restrictions are applied."""
|
||||
bot_administrator_rights: Optional[ChatAdministratorRights] = None
|
||||
"""*Optional*. A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset of *user_administrator_rights*. If not specified, no additional restrictions are applied."""
|
||||
bot_is_member: Optional[bool] = None
|
||||
"""*Optional*. Pass :code:`True` to request a chat with the bot as a member. Otherwise, no additional restrictions are applied."""
|
||||
18
aiogram/types/keyboard_button_request_user.py
Normal file
18
aiogram/types/keyboard_button_request_user.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
from typing import Optional
|
||||
|
||||
from aiogram.types import TelegramObject
|
||||
|
||||
|
||||
class KeyboardButtonRequestUser(TelegramObject):
|
||||
"""
|
||||
This object defines the criteria used to request a suitable user. The identifier of the selected user will be shared with the bot when the corresponding button is pressed.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#keyboardbuttonrequestuser
|
||||
"""
|
||||
|
||||
request_id: int
|
||||
"""Signed 32-bit identifier of the request, which will be received back in the :class:`aiogram.types.user_shared.UserShared` object. Must be unique within the message"""
|
||||
user_is_bot: Optional[bool] = None
|
||||
"""*Optional*. Pass :code:`True` to request a bot, pass :code:`False` to request a regular user. If not specified, no additional restrictions are applied."""
|
||||
user_is_premium: Optional[bool] = None
|
||||
"""*Optional*. Pass :code:`True` to request a premium user, pass :code:`False` to request a non-premium user. If not specified, no additional restrictions are applied."""
|
||||
|
|
@ -48,6 +48,7 @@ if TYPE_CHECKING:
|
|||
from .animation import Animation
|
||||
from .audio import Audio
|
||||
from .chat import Chat
|
||||
from .chat_shared import ChatShared
|
||||
from .contact import Contact
|
||||
from .dice import Dice
|
||||
from .document import Document
|
||||
|
|
@ -80,6 +81,7 @@ if TYPE_CHECKING:
|
|||
from .sticker import Sticker
|
||||
from .successful_payment import SuccessfulPayment
|
||||
from .user import User
|
||||
from .user_shared import UserShared
|
||||
from .venue import Venue
|
||||
from .video import Video
|
||||
from .video_chat_ended import VideoChatEnded
|
||||
|
|
@ -205,6 +207,10 @@ class Message(TelegramObject):
|
|||
"""*Optional*. Message is an invoice for a `payment <https://core.telegram.org/bots/api#payments>`_, information about the invoice. `More about payments » <https://core.telegram.org/bots/api#payments>`_"""
|
||||
successful_payment: Optional[SuccessfulPayment] = None
|
||||
"""*Optional*. Message is a service message about a successful payment, information about the payment. `More about payments » <https://core.telegram.org/bots/api#payments>`_"""
|
||||
user_shared: Optional[UserShared] = None
|
||||
"""*Optional*. Service message: a user was shared with the bot"""
|
||||
chat_shared: Optional[ChatShared] = None
|
||||
"""*Optional*. Service message: a chat was shared with the bot"""
|
||||
connected_website: Optional[str] = None
|
||||
"""*Optional*. The domain name of the website on which the user has logged in. `More about Telegram Login » <https://core.telegram.org/widgets/login>`_"""
|
||||
write_access_allowed: Optional[WriteAccessAllowed] = None
|
||||
|
|
|
|||
14
aiogram/types/user_shared.py
Normal file
14
aiogram/types/user_shared.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
from aiogram.types import TelegramObject
|
||||
|
||||
|
||||
class UserShared(TelegramObject):
|
||||
"""
|
||||
This object contains information about the user whose identifier was shared with the bot using a :class:`aiogram.types.keyboard_button_request_user.KeyboardButtonRequestUser` button.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#usershared
|
||||
"""
|
||||
|
||||
request_id: int
|
||||
"""Identifier of the request"""
|
||||
user_id: int
|
||||
"""Identifier of the shared user. 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. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means."""
|
||||
9
docs/api/types/chat_shared.rst
Normal file
9
docs/api/types/chat_shared.rst
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
##########
|
||||
ChatShared
|
||||
##########
|
||||
|
||||
|
||||
.. automodule:: aiogram.types.chat_shared
|
||||
:members:
|
||||
:member-order: bysource
|
||||
:undoc-members: True
|
||||
|
|
@ -75,6 +75,7 @@ Available types
|
|||
chat_member_updated
|
||||
chat_permissions
|
||||
chat_photo
|
||||
chat_shared
|
||||
contact
|
||||
dice
|
||||
document
|
||||
|
|
@ -98,6 +99,8 @@ Available types
|
|||
input_media_video
|
||||
keyboard_button
|
||||
keyboard_button_poll_type
|
||||
keyboard_button_request_chat
|
||||
keyboard_button_request_user
|
||||
location
|
||||
login_url
|
||||
menu_button
|
||||
|
|
@ -118,6 +121,7 @@ Available types
|
|||
response_parameters
|
||||
user
|
||||
user_profile_photos
|
||||
user_shared
|
||||
venue
|
||||
video
|
||||
video_chat_ended
|
||||
|
|
|
|||
9
docs/api/types/keyboard_button_request_chat.rst
Normal file
9
docs/api/types/keyboard_button_request_chat.rst
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#########################
|
||||
KeyboardButtonRequestChat
|
||||
#########################
|
||||
|
||||
|
||||
.. automodule:: aiogram.types.keyboard_button_request_chat
|
||||
:members:
|
||||
:member-order: bysource
|
||||
:undoc-members: True
|
||||
9
docs/api/types/keyboard_button_request_user.rst
Normal file
9
docs/api/types/keyboard_button_request_user.rst
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#########################
|
||||
KeyboardButtonRequestUser
|
||||
#########################
|
||||
|
||||
|
||||
.. automodule:: aiogram.types.keyboard_button_request_user
|
||||
:members:
|
||||
:member-order: bysource
|
||||
:undoc-members: True
|
||||
9
docs/api/types/user_shared.rst
Normal file
9
docs/api/types/user_shared.rst
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
##########
|
||||
UserShared
|
||||
##########
|
||||
|
||||
|
||||
.. automodule:: aiogram.types.user_shared
|
||||
:members:
|
||||
:member-order: bysource
|
||||
:undoc-members: True
|
||||
|
|
@ -147,7 +147,7 @@ features = [
|
|||
"test",
|
||||
]
|
||||
extra-dependencies = [
|
||||
"butcher @ git+https://github.com/aiogram/butcher.git@v0.1.9"
|
||||
"butcher @ git+https://github.com/aiogram/butcher.git@v0.1.10"
|
||||
]
|
||||
|
||||
[tool.hatch.envs.test]
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ class TestChatJoinRequest:
|
|||
chat_join_request = ChatJoinRequest(
|
||||
chat=Chat(id=-42, type="supergroup"),
|
||||
from_user=User(id=42, is_bot=False, first_name="Test"),
|
||||
user_chat_id=42,
|
||||
date=datetime.datetime.now(),
|
||||
)
|
||||
|
||||
|
|
@ -22,6 +23,7 @@ class TestChatJoinRequest:
|
|||
chat_join_request = ChatJoinRequest(
|
||||
chat=Chat(id=-42, type="supergroup"),
|
||||
from_user=User(id=42, is_bot=False, first_name="Test"),
|
||||
user_chat_id=42,
|
||||
date=datetime.datetime.now(),
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -434,8 +434,9 @@ class TestDispatcher:
|
|||
Update(
|
||||
update_id=42,
|
||||
chat_join_request=ChatJoinRequest(
|
||||
chat=Chat(id=42, type="private"),
|
||||
chat=Chat(id=-42, type="private"),
|
||||
from_user=User(id=42, is_bot=False, first_name="Test"),
|
||||
user_chat_id=42,
|
||||
date=datetime.datetime.now(),
|
||||
),
|
||||
),
|
||||
|
|
@ -589,8 +590,7 @@ class TestDispatcher:
|
|||
"aiogram.dispatcher.dispatcher.Dispatcher.silent_call_request",
|
||||
new_callable=AsyncMock,
|
||||
) as mocked_silent_call_request:
|
||||
result = await dispatcher._process_update(bot=bot, update=Update(update_id=42))
|
||||
print(result)
|
||||
await dispatcher._process_update(bot=bot, update=Update(update_id=42))
|
||||
mocked_silent_call_request.assert_awaited()
|
||||
|
||||
async def test_process_update_exception(self, bot: MockedBot, caplog):
|
||||
|
|
|
|||
|
|
@ -315,7 +315,8 @@ class TestChatMemberUpdatedStatusFilter:
|
|||
update = {
|
||||
"user": user,
|
||||
"until_date": datetime.now(),
|
||||
"is_anonymous": False,
|
||||
"is_anonymous": True,
|
||||
"custom_title": True,
|
||||
"can_be_edited": True,
|
||||
"can_manage_chat": True,
|
||||
"can_delete_messages": True,
|
||||
|
|
@ -327,12 +328,17 @@ class TestChatMemberUpdatedStatusFilter:
|
|||
"can_post_messages": True,
|
||||
"can_edit_messages": True,
|
||||
"can_pin_messages": True,
|
||||
"can_manage_topics": True,
|
||||
"can_send_messages": True,
|
||||
"can_send_media_messages": True,
|
||||
"can_send_audios": True,
|
||||
"can_send_documents": True,
|
||||
"can_send_photos": True,
|
||||
"can_send_videos": True,
|
||||
"can_send_video_notes": True,
|
||||
"can_send_voice_notes": True,
|
||||
"can_send_polls": True,
|
||||
"can_send_other_messages": True,
|
||||
"can_add_web_page_previews": True,
|
||||
"can_manage_topics": True,
|
||||
}
|
||||
event = ChatMemberUpdated(
|
||||
chat=Chat(id=42, type="test"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue