`. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.\n",
"name": "thumbnail"
},
{
"type": "String",
"required": true,
- "description": "Format of the thumbnail, must be one of 'static' for a .WEBP or .PNG image, 'animated' for a .TGS animation, or 'video' for a WEBM video",
- "html_description": "| Format of the thumbnail, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation, or “video” for a WEBM video | ",
- "rst_description": "Format of the thumbnail, must be one of 'static' for a **.WEBP** or **.PNG** image, 'animated' for a **.TGS** animation, or 'video' for a **WEBM** video\n",
+ "description": "Format of the thumbnail, must be one of 'static' for a .WEBP or .PNG image, 'animated' for a .TGS animation, or 'video' for a .WEBM video",
+ "html_description": "Format of the thumbnail, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation, or “video” for a .WEBM video | ",
+ "rst_description": "Format of the thumbnail, must be one of 'static' for a **.WEBP** or **.PNG** image, 'animated' for a **.TGS** animation, or 'video' for a **.WEBM** video\n",
"name": "format"
}
],
@@ -13258,6 +13258,14 @@
"name": "star_count",
"required": true
},
+ {
+ "type": "Integer",
+ "description": "The number of Telegram Stars that must be paid to upgrade the gift to a unique one",
+ "html_description": "Optional. The number of Telegram Stars that must be paid to upgrade the gift to a unique one | ",
+ "rst_description": "*Optional*. The number of Telegram Stars that must be paid to upgrade the gift to a unique one\n",
+ "name": "upgrade_star_count",
+ "required": false
+ },
{
"type": "Integer",
"description": "The total number of the gifts of this type that can be sent; for limited gifts only",
@@ -13327,6 +13335,14 @@
"rst_description": "Identifier of the gift\n",
"name": "gift_id"
},
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver",
+ "html_description": "Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver | ",
+ "rst_description": "Pass :code:`True` to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver\n",
+ "name": "pay_for_upgrade"
+ },
{
"type": "String",
"required": false,
@@ -13353,6 +13369,94 @@
}
],
"category": "methods"
+ },
+ {
+ "anchor": "verifyuser",
+ "name": "verifyUser",
+ "description": "Verifies a user on behalf of the organization which is represented by the bot. Returns True on success.",
+ "html_description": "Verifies a user on behalf of the organization which is represented by the bot. Returns True on success.
",
+ "rst_description": "Verifies a user on behalf of the organization which is represented by the bot. Returns :code:`True` on success.",
+ "annotations": [
+ {
+ "type": "Integer",
+ "required": true,
+ "description": "Unique identifier of the target user",
+ "html_description": "Unique identifier of the target user | ",
+ "rst_description": "Unique identifier of the target user\n",
+ "name": "user_id"
+ },
+ {
+ "type": "String",
+ "required": false,
+ "description": "Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.",
+ "html_description": "Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description. | ",
+ "rst_description": "Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.\n",
+ "name": "custom_description"
+ }
+ ],
+ "category": "methods"
+ },
+ {
+ "anchor": "verifychat",
+ "name": "verifyChat",
+ "description": "Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success.",
+ "html_description": "Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success.
",
+ "rst_description": "Verifies a chat on behalf of the organization which is represented by the bot. Returns :code:`True` on success.",
+ "annotations": [
+ {
+ "type": "Integer or String",
+ "required": true,
+ "description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)",
+ "html_description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername) | ",
+ "rst_description": "Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)\n",
+ "name": "chat_id"
+ },
+ {
+ "type": "String",
+ "required": false,
+ "description": "Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.",
+ "html_description": "Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description. | ",
+ "rst_description": "Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.\n",
+ "name": "custom_description"
+ }
+ ],
+ "category": "methods"
+ },
+ {
+ "anchor": "removeuserverification",
+ "name": "removeUserVerification",
+ "description": "Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success.",
+ "html_description": "Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success.
",
+ "rst_description": "Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns :code:`True` on success.",
+ "annotations": [
+ {
+ "type": "Integer",
+ "required": true,
+ "description": "Unique identifier of the target user",
+ "html_description": "Unique identifier of the target user | ",
+ "rst_description": "Unique identifier of the target user\n",
+ "name": "user_id"
+ }
+ ],
+ "category": "methods"
+ },
+ {
+ "anchor": "removechatverification",
+ "name": "removeChatVerification",
+ "description": "Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success.",
+ "html_description": "Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success.
",
+ "rst_description": "Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns :code:`True` on success.",
+ "annotations": [
+ {
+ "type": "Integer or String",
+ "required": true,
+ "description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)",
+ "html_description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername) | ",
+ "rst_description": "Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)\n",
+ "name": "chat_id"
+ }
+ ],
+ "category": "methods"
}
],
"description": "The following methods and objects allow your bot to handle stickers and sticker sets."
@@ -13575,14 +13679,6 @@
"name": "url",
"required": false
},
- {
- "type": "Boolean",
- "description": "Pass True if you don't want the URL to be shown in the message",
- "html_description": "Optional. Pass True if you don't want the URL to be shown in the message | ",
- "rst_description": "*Optional*. Pass :code:`True` if you don't want the URL to be shown in the message\n",
- "name": "hide_url",
- "required": false
- },
{
"type": "String",
"description": "Short description of the result",
@@ -13765,9 +13861,9 @@
},
{
"type": "String",
- "description": "A valid URL for the GIF file. File size must not exceed 1MB",
- "html_description": "A valid URL for the GIF file. File size must not exceed 1MB | ",
- "rst_description": "A valid URL for the GIF file. File size must not exceed 1MB\n",
+ "description": "A valid URL for the GIF file",
+ "html_description": "A valid URL for the GIF file | ",
+ "rst_description": "A valid URL for the GIF file\n",
"name": "gif_url",
"required": true
},
@@ -13895,9 +13991,9 @@
},
{
"type": "String",
- "description": "A valid URL for the MPEG4 file. File size must not exceed 1MB",
- "html_description": "A valid URL for the MPEG4 file. File size must not exceed 1MB | ",
- "rst_description": "A valid URL for the MPEG4 file. File size must not exceed 1MB\n",
+ "description": "A valid URL for the MPEG4 file",
+ "html_description": "A valid URL for the MPEG4 file | ",
+ "rst_description": "A valid URL for the MPEG4 file\n",
"name": "mpeg4_url",
"required": true
},
diff --git a/.butcher/types/BackgroundTypePattern/entity.json b/.butcher/types/BackgroundTypePattern/entity.json
index 1f286b9f..336bed87 100644
--- a/.butcher/types/BackgroundTypePattern/entity.json
+++ b/.butcher/types/BackgroundTypePattern/entity.json
@@ -7,9 +7,9 @@
"object": {
"anchor": "backgroundtypepattern",
"name": "BackgroundTypePattern",
- "description": "The background is a PNG or TGV (gzipped subset of SVG with MIME type 'application/x-tgwallpattern') pattern to be combined with the background fill chosen by the user.",
- "html_description": "The background is a PNG or TGV (gzipped subset of SVG with MIME type “application/x-tgwallpattern”) pattern to be combined with the background fill chosen by the user.
",
- "rst_description": "The background is a PNG or TGV (gzipped subset of SVG with MIME type 'application/x-tgwallpattern') pattern to be combined with the background fill chosen by the user.",
+ "description": "The background is a .PNG or .TGV (gzipped subset of SVG with MIME type 'application/x-tgwallpattern') pattern to be combined with the background fill chosen by the user.",
+ "html_description": "The background is a .PNG or .TGV (gzipped subset of SVG with MIME type “application/x-tgwallpattern”) pattern to be combined with the background fill chosen by the user.
",
+ "rst_description": "The background is a .PNG or .TGV (gzipped subset of SVG with MIME type 'application/x-tgwallpattern') pattern to be combined with the background fill chosen by the user.",
"annotations": [
{
"type": "String",
diff --git a/.butcher/types/Gift/entity.json b/.butcher/types/Gift/entity.json
index ce7728d6..46454a3e 100644
--- a/.butcher/types/Gift/entity.json
+++ b/.butcher/types/Gift/entity.json
@@ -35,6 +35,14 @@
"name": "star_count",
"required": true
},
+ {
+ "type": "Integer",
+ "description": "The number of Telegram Stars that must be paid to upgrade the gift to a unique one",
+ "html_description": "Optional. The number of Telegram Stars that must be paid to upgrade the gift to a unique one | ",
+ "rst_description": "*Optional*. The number of Telegram Stars that must be paid to upgrade the gift to a unique one\n",
+ "name": "upgrade_star_count",
+ "required": false
+ },
{
"type": "Integer",
"description": "The total number of the gifts of this type that can be sent; for limited gifts only",
diff --git a/.butcher/types/InlineQueryResultArticle/entity.json b/.butcher/types/InlineQueryResultArticle/entity.json
index eba5d318..c9622b2a 100644
--- a/.butcher/types/InlineQueryResultArticle/entity.json
+++ b/.butcher/types/InlineQueryResultArticle/entity.json
@@ -59,14 +59,6 @@
"name": "url",
"required": false
},
- {
- "type": "Boolean",
- "description": "Pass True if you don't want the URL to be shown in the message",
- "html_description": "Optional. Pass True if you don't want the URL to be shown in the message | ",
- "rst_description": "*Optional*. Pass :code:`True` if you don't want the URL to be shown in the message\n",
- "name": "hide_url",
- "required": false
- },
{
"type": "String",
"description": "Short description of the result",
@@ -98,6 +90,18 @@
"rst_description": "*Optional*. Thumbnail height\n",
"name": "thumbnail_height",
"required": false
+ },
+ {
+ "type": "Boolean",
+ "description": "Pass True if you don't want the URL to be shown in the message",
+ "html_description": "Optional. Pass True if you don't want the URL to be shown in the message | ",
+ "rst_description": "*Optional*. Pass :code:`True` if you don't want the URL to be shown in the message\n",
+ "name": "hide_url",
+ "required": false,
+ "deprecated": {
+ "version": "8.2",
+ "release_date": "2025-01-01"
+ }
}
],
"category": "types"
diff --git a/.butcher/types/InlineQueryResultGif/entity.json b/.butcher/types/InlineQueryResultGif/entity.json
index 7c104615..ee825305 100644
--- a/.butcher/types/InlineQueryResultGif/entity.json
+++ b/.butcher/types/InlineQueryResultGif/entity.json
@@ -29,9 +29,9 @@
},
{
"type": "String",
- "description": "A valid URL for the GIF file. File size must not exceed 1MB",
- "html_description": "A valid URL for the GIF file. File size must not exceed 1MB | ",
- "rst_description": "A valid URL for the GIF file. File size must not exceed 1MB\n",
+ "description": "A valid URL for the GIF file",
+ "html_description": "A valid URL for the GIF file | ",
+ "rst_description": "A valid URL for the GIF file\n",
"name": "gif_url",
"required": true
},
diff --git a/.butcher/types/InlineQueryResultMpeg4Gif/entity.json b/.butcher/types/InlineQueryResultMpeg4Gif/entity.json
index fa4c3e81..fc309461 100644
--- a/.butcher/types/InlineQueryResultMpeg4Gif/entity.json
+++ b/.butcher/types/InlineQueryResultMpeg4Gif/entity.json
@@ -29,9 +29,9 @@
},
{
"type": "String",
- "description": "A valid URL for the MPEG4 file. File size must not exceed 1MB",
- "html_description": "A valid URL for the MPEG4 file. File size must not exceed 1MB | ",
- "rst_description": "A valid URL for the MPEG4 file. File size must not exceed 1MB\n",
+ "description": "A valid URL for the MPEG4 file",
+ "html_description": "A valid URL for the MPEG4 file | ",
+ "rst_description": "A valid URL for the MPEG4 file\n",
"name": "mpeg4_url",
"required": true
},
diff --git a/.butcher/types/InputSticker/entity.json b/.butcher/types/InputSticker/entity.json
index 2df660ae..0ec7ae40 100644
--- a/.butcher/types/InputSticker/entity.json
+++ b/.butcher/types/InputSticker/entity.json
@@ -21,9 +21,9 @@
},
{
"type": "String",
- "description": "Format of the added sticker, must be one of 'static' for a .WEBP or .PNG image, 'animated' for a .TGS animation, 'video' for a WEBM video",
- "html_description": "Format of the added sticker, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation, “video” for a WEBM video | ",
- "rst_description": "Format of the added sticker, must be one of 'static' for a **.WEBP** or **.PNG** image, 'animated' for a **.TGS** animation, 'video' for a **WEBM** video\n",
+ "description": "Format of the added sticker, must be one of 'static' for a .WEBP or .PNG image, 'animated' for a .TGS animation, 'video' for a .WEBM video",
+ "html_description": "Format of the added sticker, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation, “video” for a .WEBM video | ",
+ "rst_description": "Format of the added sticker, must be one of 'static' for a **.WEBP** or **.PNG** image, 'animated' for a **.TGS** animation, 'video' for a **.WEBM** video\n",
"name": "format",
"required": true
},
diff --git a/CHANGES/1623.feature.rst b/CHANGES/1623.feature.rst
new file mode 100644
index 00000000..3bf57d62
--- /dev/null
+++ b/CHANGES/1623.feature.rst
@@ -0,0 +1,6 @@
+Added full support of the `Bot API 8.2 `_
+
+- Added the methods :class:`aiogram.methods.verify_user.VerifyUser`, :class:`aiogram.methods.verify_chat.VerifyChat`, :class:`aiogram.methods.remove_user_verification.RemoveUserVerification` and :class:`aiogram.methods.remove_chat_verification.RemoveChatVerification`, allowing bots to manage verifications on behalf of an organization.
+- Added the field :code:`upgrade_star_count` to the class :class:`aiogram.types.gift.Gift`.
+- Added the parameter :code:`pay_for_upgrade` to the method :class:`aiogram.methods.send_gift.SendGift`.
+- Removed the field :code:`hide_url` from the class :class:`aiogram.types.inline_query_result_article.InlineQueryResultArticle`. Pass an empty string as :code:`url` instead.
diff --git a/aiogram/client/bot.py b/aiogram/client/bot.py
index 592173e4..a09dda28 100644
--- a/aiogram/client/bot.py
+++ b/aiogram/client/bot.py
@@ -93,6 +93,8 @@ from ..methods import (
PinChatMessage,
PromoteChatMember,
RefundStarPayment,
+ RemoveChatVerification,
+ RemoveUserVerification,
ReopenForumTopic,
ReopenGeneralForumTopic,
ReplaceStickerInSet,
@@ -154,6 +156,8 @@ from ..methods import (
UnpinAllGeneralForumTopicMessages,
UnpinChatMessage,
UploadStickerFile,
+ VerifyChat,
+ VerifyUser,
)
from ..types import (
BotCommand,
@@ -3816,7 +3820,7 @@ class Bot:
request_timeout: Optional[int] = None,
) -> bool:
"""
- Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized :class:`aiogram.types.update.Update`. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns :code:`True` on success.
+ Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized :class:`aiogram.types.update.Update`. In case of an unsuccessful request (a request with response `HTTP status code `_ different from :code:`2XY`), we will repeat the request and give up after a reasonable amount of attempts. Returns :code:`True` on success.
If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter *secret_token*. If specified, the request will contain a header 'X-Telegram-Bot-Api-Secret-Token' with the secret token as content.
**Notes**
@@ -4373,8 +4377,8 @@ class Bot:
:param name: Sticker set name
:param user_id: User identifier of the sticker set owner
- :param format: Format of the thumbnail, must be one of 'static' for a **.WEBP** or **.PNG** image, 'animated' for a **.TGS** animation, or 'video' for a **WEBM** video
- :param thumbnail: A **.WEBP** or **.PNG** image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a **.TGS** animation with a thumbnail up to 32 kilobytes in size (see `https://core.telegram.org/stickers#animation-requirements `_`https://core.telegram.org/stickers#animation-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-requirements `_`https://core.telegram.org/stickers#video-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 » `. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.
+ :param format: Format of the thumbnail, must be one of 'static' for a **.WEBP** or **.PNG** image, 'animated' for a **.TGS** animation, or 'video' for a **.WEBM** video
+ :param thumbnail: A **.WEBP** or **.PNG** image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a **.TGS** animation with a thumbnail up to 32 kilobytes in size (see `https://core.telegram.org/stickers#animation-requirements `_`https://core.telegram.org/stickers#animation-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-requirements `_`https://core.telegram.org/stickers#video-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 » `. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.
:param request_timeout: Request timeout
:return: Returns :code:`True` on success.
"""
@@ -4936,6 +4940,7 @@ class Bot:
self,
user_id: int,
gift_id: str,
+ pay_for_upgrade: Optional[bool] = None,
text: Optional[str] = None,
text_parse_mode: Optional[str] = None,
text_entities: Optional[list[MessageEntity]] = None,
@@ -4948,6 +4953,7 @@ class Bot:
:param user_id: Unique identifier of the target user that will receive the gift
:param gift_id: Identifier of the gift
+ :param pay_for_upgrade: Pass :code:`True` to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver
:param text: Text that will be shown along with the gift; 0-255 characters
:param text_parse_mode: Mode for parsing entities in the text. See `formatting options `_ for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.
:param text_entities: A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of *text_parse_mode*. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.
@@ -4958,6 +4964,7 @@ class Bot:
call = SendGift(
user_id=user_id,
gift_id=gift_id,
+ pay_for_upgrade=pay_for_upgrade,
text=text,
text_parse_mode=text_parse_mode,
text_entities=text_entities,
@@ -4991,3 +4998,89 @@ class Bot:
emoji_status_expiration_date=emoji_status_expiration_date,
)
return await self(call, request_timeout=request_timeout)
+
+ async def remove_chat_verification(
+ self,
+ chat_id: Union[int, str],
+ request_timeout: Optional[int] = None,
+ ) -> bool:
+ """
+ Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns :code:`True` on success.
+
+ Source: https://core.telegram.org/bots/api#removechatverification
+
+ :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.
+ """
+
+ call = RemoveChatVerification(
+ chat_id=chat_id,
+ )
+ return await self(call, request_timeout=request_timeout)
+
+ async def remove_user_verification(
+ self,
+ user_id: int,
+ request_timeout: Optional[int] = None,
+ ) -> bool:
+ """
+ Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns :code:`True` on success.
+
+ Source: https://core.telegram.org/bots/api#removeuserverification
+
+ :param user_id: Unique identifier of the target user
+ :param request_timeout: Request timeout
+ :return: Returns :code:`True` on success.
+ """
+
+ call = RemoveUserVerification(
+ user_id=user_id,
+ )
+ return await self(call, request_timeout=request_timeout)
+
+ async def verify_chat(
+ self,
+ chat_id: Union[int, str],
+ custom_description: Optional[str] = None,
+ request_timeout: Optional[int] = None,
+ ) -> bool:
+ """
+ Verifies a chat on behalf of the organization which is represented by the bot. Returns :code:`True` on success.
+
+ Source: https://core.telegram.org/bots/api#verifychat
+
+ :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
+ :param custom_description: Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.
+ :param request_timeout: Request timeout
+ :return: Returns :code:`True` on success.
+ """
+
+ call = VerifyChat(
+ chat_id=chat_id,
+ custom_description=custom_description,
+ )
+ return await self(call, request_timeout=request_timeout)
+
+ async def verify_user(
+ self,
+ user_id: int,
+ custom_description: Optional[str] = None,
+ request_timeout: Optional[int] = None,
+ ) -> bool:
+ """
+ Verifies a user on behalf of the organization which is represented by the bot. Returns :code:`True` on success.
+
+ Source: https://core.telegram.org/bots/api#verifyuser
+
+ :param user_id: Unique identifier of the target user
+ :param custom_description: Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.
+ :param request_timeout: Request timeout
+ :return: Returns :code:`True` on success.
+ """
+
+ call = VerifyUser(
+ user_id=user_id,
+ custom_description=custom_description,
+ )
+ return await self(call, request_timeout=request_timeout)
diff --git a/aiogram/methods/__init__.py b/aiogram/methods/__init__.py
index 893f4f73..c40461fe 100644
--- a/aiogram/methods/__init__.py
+++ b/aiogram/methods/__init__.py
@@ -70,6 +70,8 @@ from .log_out import LogOut
from .pin_chat_message import PinChatMessage
from .promote_chat_member import PromoteChatMember
from .refund_star_payment import RefundStarPayment
+from .remove_chat_verification import RemoveChatVerification
+from .remove_user_verification import RemoveUserVerification
from .reopen_forum_topic import ReopenForumTopic
from .reopen_general_forum_topic import ReopenGeneralForumTopic
from .replace_sticker_in_set import ReplaceStickerInSet
@@ -130,6 +132,8 @@ from .unpin_all_forum_topic_messages import UnpinAllForumTopicMessages
from .unpin_all_general_forum_topic_messages import UnpinAllGeneralForumTopicMessages
from .unpin_chat_message import UnpinChatMessage
from .upload_sticker_file import UploadStickerFile
+from .verify_chat import VerifyChat
+from .verify_user import VerifyUser
__all__ = (
"AddStickerToSet",
@@ -203,6 +207,8 @@ __all__ = (
"PinChatMessage",
"PromoteChatMember",
"RefundStarPayment",
+ "RemoveChatVerification",
+ "RemoveUserVerification",
"ReopenForumTopic",
"ReopenGeneralForumTopic",
"ReplaceStickerInSet",
@@ -266,4 +272,6 @@ __all__ = (
"UnpinAllGeneralForumTopicMessages",
"UnpinChatMessage",
"UploadStickerFile",
+ "VerifyChat",
+ "VerifyUser",
)
diff --git a/aiogram/methods/remove_chat_verification.py b/aiogram/methods/remove_chat_verification.py
new file mode 100644
index 00000000..ff242c48
--- /dev/null
+++ b/aiogram/methods/remove_chat_verification.py
@@ -0,0 +1,32 @@
+from __future__ import annotations
+
+from typing import TYPE_CHECKING, Any, Union
+
+from .base import TelegramMethod
+
+
+class RemoveChatVerification(TelegramMethod[bool]):
+ """
+ Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns :code:`True` on success.
+
+ Source: https://core.telegram.org/bots/api#removechatverification
+ """
+
+ __returning__ = bool
+ __api_method__ = "removeChatVerification"
+
+ chat_id: Union[int, str]
+ """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
+
+ if TYPE_CHECKING:
+ # DO NOT EDIT MANUALLY!!!
+ # This section was auto-generated via `butcher`
+
+ def __init__(
+ __pydantic__self__, *, chat_id: Union[int, str], **__pydantic_kwargs: Any
+ ) -> None:
+ # DO NOT EDIT MANUALLY!!!
+ # This method was auto-generated via `butcher`
+ # Is needed only for type checking and IDE support without any additional plugins
+
+ super().__init__(chat_id=chat_id, **__pydantic_kwargs)
diff --git a/aiogram/methods/remove_user_verification.py b/aiogram/methods/remove_user_verification.py
new file mode 100644
index 00000000..0cd4b4c8
--- /dev/null
+++ b/aiogram/methods/remove_user_verification.py
@@ -0,0 +1,30 @@
+from __future__ import annotations
+
+from typing import TYPE_CHECKING, Any
+
+from .base import TelegramMethod
+
+
+class RemoveUserVerification(TelegramMethod[bool]):
+ """
+ Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns :code:`True` on success.
+
+ Source: https://core.telegram.org/bots/api#removeuserverification
+ """
+
+ __returning__ = bool
+ __api_method__ = "removeUserVerification"
+
+ user_id: int
+ """Unique identifier of the target user"""
+
+ if TYPE_CHECKING:
+ # DO NOT EDIT MANUALLY!!!
+ # This section was auto-generated via `butcher`
+
+ def __init__(__pydantic__self__, *, user_id: int, **__pydantic_kwargs: Any) -> None:
+ # DO NOT EDIT MANUALLY!!!
+ # This method was auto-generated via `butcher`
+ # Is needed only for type checking and IDE support without any additional plugins
+
+ super().__init__(user_id=user_id, **__pydantic_kwargs)
diff --git a/aiogram/methods/send_gift.py b/aiogram/methods/send_gift.py
index a07e9f45..73b6ab60 100644
--- a/aiogram/methods/send_gift.py
+++ b/aiogram/methods/send_gift.py
@@ -20,6 +20,8 @@ class SendGift(TelegramMethod[bool]):
"""Unique identifier of the target user that will receive the gift"""
gift_id: str
"""Identifier of the gift"""
+ pay_for_upgrade: Optional[bool] = None
+ """Pass :code:`True` to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver"""
text: Optional[str] = None
"""Text that will be shown along with the gift; 0-255 characters"""
text_parse_mode: Optional[str] = None
@@ -36,6 +38,7 @@ class SendGift(TelegramMethod[bool]):
*,
user_id: int,
gift_id: str,
+ pay_for_upgrade: Optional[bool] = None,
text: Optional[str] = None,
text_parse_mode: Optional[str] = None,
text_entities: Optional[list[MessageEntity]] = None,
@@ -48,6 +51,7 @@ class SendGift(TelegramMethod[bool]):
super().__init__(
user_id=user_id,
gift_id=gift_id,
+ pay_for_upgrade=pay_for_upgrade,
text=text,
text_parse_mode=text_parse_mode,
text_entities=text_entities,
diff --git a/aiogram/methods/set_sticker_set_thumbnail.py b/aiogram/methods/set_sticker_set_thumbnail.py
index ef83f701..64140ee4 100644
--- a/aiogram/methods/set_sticker_set_thumbnail.py
+++ b/aiogram/methods/set_sticker_set_thumbnail.py
@@ -21,9 +21,9 @@ class SetStickerSetThumbnail(TelegramMethod[bool]):
user_id: int
"""User identifier of the sticker set owner"""
format: str
- """Format of the thumbnail, must be one of 'static' for a **.WEBP** or **.PNG** image, 'animated' for a **.TGS** animation, or 'video' for a **WEBM** video"""
+ """Format of the thumbnail, must be one of 'static' for a **.WEBP** or **.PNG** image, 'animated' for a **.TGS** animation, or 'video' for a **.WEBM** video"""
thumbnail: Optional[Union[InputFile, str]] = None
- """A **.WEBP** or **.PNG** image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a **.TGS** animation with a thumbnail up to 32 kilobytes in size (see `https://core.telegram.org/stickers#animation-requirements `_`https://core.telegram.org/stickers#animation-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-requirements `_`https://core.telegram.org/stickers#video-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 » `. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail."""
+ """A **.WEBP** or **.PNG** image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a **.TGS** animation with a thumbnail up to 32 kilobytes in size (see `https://core.telegram.org/stickers#animation-requirements `_`https://core.telegram.org/stickers#animation-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-requirements `_`https://core.telegram.org/stickers#video-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 » `. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail."""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/set_webhook.py b/aiogram/methods/set_webhook.py
index 01c74f9c..e7076839 100644
--- a/aiogram/methods/set_webhook.py
+++ b/aiogram/methods/set_webhook.py
@@ -8,7 +8,7 @@ from .base import TelegramMethod
class SetWebhook(TelegramMethod[bool]):
"""
- Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized :class:`aiogram.types.update.Update`. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns :code:`True` on success.
+ Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized :class:`aiogram.types.update.Update`. In case of an unsuccessful request (a request with response `HTTP status code `_ different from :code:`2XY`), we will repeat the request and give up after a reasonable amount of attempts. Returns :code:`True` on success.
If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter *secret_token*. If specified, the request will contain a header 'X-Telegram-Bot-Api-Secret-Token' with the secret token as content.
**Notes**
diff --git a/aiogram/methods/verify_chat.py b/aiogram/methods/verify_chat.py
new file mode 100644
index 00000000..9f1c36e4
--- /dev/null
+++ b/aiogram/methods/verify_chat.py
@@ -0,0 +1,40 @@
+from __future__ import annotations
+
+from typing import TYPE_CHECKING, Any, Optional, Union
+
+from .base import TelegramMethod
+
+
+class VerifyChat(TelegramMethod[bool]):
+ """
+ Verifies a chat on behalf of the organization which is represented by the bot. Returns :code:`True` on success.
+
+ Source: https://core.telegram.org/bots/api#verifychat
+ """
+
+ __returning__ = bool
+ __api_method__ = "verifyChat"
+
+ chat_id: Union[int, str]
+ """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
+ custom_description: Optional[str] = None
+ """Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description."""
+
+ if TYPE_CHECKING:
+ # DO NOT EDIT MANUALLY!!!
+ # This section was auto-generated via `butcher`
+
+ def __init__(
+ __pydantic__self__,
+ *,
+ chat_id: Union[int, str],
+ custom_description: Optional[str] = None,
+ **__pydantic_kwargs: Any,
+ ) -> None:
+ # DO NOT EDIT MANUALLY!!!
+ # This method was auto-generated via `butcher`
+ # Is needed only for type checking and IDE support without any additional plugins
+
+ super().__init__(
+ chat_id=chat_id, custom_description=custom_description, **__pydantic_kwargs
+ )
diff --git a/aiogram/methods/verify_user.py b/aiogram/methods/verify_user.py
new file mode 100644
index 00000000..3518dfaf
--- /dev/null
+++ b/aiogram/methods/verify_user.py
@@ -0,0 +1,40 @@
+from __future__ import annotations
+
+from typing import TYPE_CHECKING, Any, Optional
+
+from .base import TelegramMethod
+
+
+class VerifyUser(TelegramMethod[bool]):
+ """
+ Verifies a user on behalf of the organization which is represented by the bot. Returns :code:`True` on success.
+
+ Source: https://core.telegram.org/bots/api#verifyuser
+ """
+
+ __returning__ = bool
+ __api_method__ = "verifyUser"
+
+ user_id: int
+ """Unique identifier of the target user"""
+ custom_description: Optional[str] = None
+ """Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description."""
+
+ if TYPE_CHECKING:
+ # DO NOT EDIT MANUALLY!!!
+ # This section was auto-generated via `butcher`
+
+ def __init__(
+ __pydantic__self__,
+ *,
+ user_id: int,
+ custom_description: Optional[str] = None,
+ **__pydantic_kwargs: Any,
+ ) -> None:
+ # DO NOT EDIT MANUALLY!!!
+ # This method was auto-generated via `butcher`
+ # Is needed only for type checking and IDE support without any additional plugins
+
+ super().__init__(
+ user_id=user_id, custom_description=custom_description, **__pydantic_kwargs
+ )
diff --git a/aiogram/types/background_type_pattern.py b/aiogram/types/background_type_pattern.py
index 29c383c2..0c3ba3a3 100644
--- a/aiogram/types/background_type_pattern.py
+++ b/aiogram/types/background_type_pattern.py
@@ -13,7 +13,7 @@ if TYPE_CHECKING:
class BackgroundTypePattern(BackgroundType):
"""
- The background is a PNG or TGV (gzipped subset of SVG with MIME type 'application/x-tgwallpattern') pattern to be combined with the background fill chosen by the user.
+ The background is a .PNG or .TGV (gzipped subset of SVG with MIME type 'application/x-tgwallpattern') pattern to be combined with the background fill chosen by the user.
Source: https://core.telegram.org/bots/api#backgroundtypepattern
"""
diff --git a/aiogram/types/gift.py b/aiogram/types/gift.py
index e25eb3ec..77be63ad 100644
--- a/aiogram/types/gift.py
+++ b/aiogram/types/gift.py
@@ -21,6 +21,8 @@ class Gift(TelegramObject):
"""The sticker that represents the gift"""
star_count: int
"""The number of Telegram Stars that must be paid to send the sticker"""
+ upgrade_star_count: Optional[int] = None
+ """*Optional*. The number of Telegram Stars that must be paid to upgrade the gift to a unique one"""
total_count: Optional[int] = None
"""*Optional*. The total number of the gifts of this type that can be sent; for limited gifts only"""
remaining_count: Optional[int] = None
@@ -36,6 +38,7 @@ class Gift(TelegramObject):
id: str,
sticker: Sticker,
star_count: int,
+ upgrade_star_count: Optional[int] = None,
total_count: Optional[int] = None,
remaining_count: Optional[int] = None,
**__pydantic_kwargs: Any,
@@ -48,6 +51,7 @@ class Gift(TelegramObject):
id=id,
sticker=sticker,
star_count=star_count,
+ upgrade_star_count=upgrade_star_count,
total_count=total_count,
remaining_count=remaining_count,
**__pydantic_kwargs,
diff --git a/aiogram/types/inline_query_result_article.py b/aiogram/types/inline_query_result_article.py
index c9987382..afd8ffdc 100644
--- a/aiogram/types/inline_query_result_article.py
+++ b/aiogram/types/inline_query_result_article.py
@@ -2,6 +2,8 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Any, Literal, Optional, Union
+from pydantic import Field
+
from ..enums import InlineQueryResultType
from .inline_query_result import InlineQueryResult
@@ -39,8 +41,6 @@ class InlineQueryResultArticle(InlineQueryResult):
"""*Optional*. `Inline keyboard `_ attached to the message"""
url: Optional[str] = None
"""*Optional*. URL of the result"""
- hide_url: Optional[bool] = None
- """*Optional*. Pass :code:`True` if you don't want the URL to be shown in the message"""
description: Optional[str] = None
"""*Optional*. Short description of the result"""
thumbnail_url: Optional[str] = None
@@ -49,6 +49,11 @@ class InlineQueryResultArticle(InlineQueryResult):
"""*Optional*. Thumbnail width"""
thumbnail_height: Optional[int] = None
"""*Optional*. Thumbnail height"""
+ hide_url: Optional[bool] = Field(None, json_schema_extra={"deprecated": True})
+ """*Optional*. Pass :code:`True` if you don't want the URL to be shown in the message
+
+.. deprecated:: API:8.2
+ https://core.telegram.org/bots/api-changelog#january-1-2025"""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
@@ -69,11 +74,11 @@ class InlineQueryResultArticle(InlineQueryResult):
],
reply_markup: Optional[InlineKeyboardMarkup] = None,
url: Optional[str] = None,
- hide_url: Optional[bool] = None,
description: Optional[str] = None,
thumbnail_url: Optional[str] = None,
thumbnail_width: Optional[int] = None,
thumbnail_height: Optional[int] = None,
+ hide_url: Optional[bool] = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
@@ -87,10 +92,10 @@ class InlineQueryResultArticle(InlineQueryResult):
input_message_content=input_message_content,
reply_markup=reply_markup,
url=url,
- hide_url=hide_url,
description=description,
thumbnail_url=thumbnail_url,
thumbnail_width=thumbnail_width,
thumbnail_height=thumbnail_height,
+ hide_url=hide_url,
**__pydantic_kwargs,
)
diff --git a/aiogram/types/inline_query_result_gif.py b/aiogram/types/inline_query_result_gif.py
index 2f56c652..cedc588c 100644
--- a/aiogram/types/inline_query_result_gif.py
+++ b/aiogram/types/inline_query_result_gif.py
@@ -28,7 +28,7 @@ class InlineQueryResultGif(InlineQueryResult):
id: str
"""Unique identifier for this result, 1-64 bytes"""
gif_url: str
- """A valid URL for the GIF file. File size must not exceed 1MB"""
+ """A valid URL for the GIF file"""
thumbnail_url: str
"""URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result"""
gif_width: Optional[int] = None
diff --git a/aiogram/types/inline_query_result_mpeg4_gif.py b/aiogram/types/inline_query_result_mpeg4_gif.py
index e1a39ae8..9fd1e716 100644
--- a/aiogram/types/inline_query_result_mpeg4_gif.py
+++ b/aiogram/types/inline_query_result_mpeg4_gif.py
@@ -28,7 +28,7 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult):
id: str
"""Unique identifier for this result, 1-64 bytes"""
mpeg4_url: str
- """A valid URL for the MPEG4 file. File size must not exceed 1MB"""
+ """A valid URL for the MPEG4 file"""
thumbnail_url: str
"""URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result"""
mpeg4_width: Optional[int] = None
diff --git a/aiogram/types/input_sticker.py b/aiogram/types/input_sticker.py
index 76fcc4b1..2971d712 100644
--- a/aiogram/types/input_sticker.py
+++ b/aiogram/types/input_sticker.py
@@ -19,7 +19,7 @@ class InputSticker(TelegramObject):
sticker: Union[InputFile, str]
"""The added sticker. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, upload a new one using multipart/form-data, or pass 'attach://' to upload a new one using multipart/form-data under name. Animated and video stickers can't be uploaded via HTTP URL. :ref:`More information on Sending Files » `"""
format: str
- """Format of the added sticker, must be one of 'static' for a **.WEBP** or **.PNG** image, 'animated' for a **.TGS** animation, 'video' for a **WEBM** video"""
+ """Format of the added sticker, must be one of 'static' for a **.WEBP** or **.PNG** image, 'animated' for a **.TGS** animation, 'video' for a **.WEBM** video"""
emoji_list: list[str]
"""List of 1-20 emoji associated with the sticker"""
mask_position: Optional[MaskPosition] = None
diff --git a/docs/api/methods/index.rst b/docs/api/methods/index.rst
index 8030927b..b6aadc07 100644
--- a/docs/api/methods/index.rst
+++ b/docs/api/methods/index.rst
@@ -18,6 +18,8 @@ Stickers
get_available_gifts
get_custom_emoji_stickers
get_sticker_set
+ remove_chat_verification
+ remove_user_verification
replace_sticker_in_set
send_gift
send_sticker
@@ -29,6 +31,8 @@ Stickers
set_sticker_set_thumbnail
set_sticker_set_title
upload_sticker_file
+ verify_chat
+ verify_user
Available methods
=================
diff --git a/docs/api/methods/remove_chat_verification.rst b/docs/api/methods/remove_chat_verification.rst
new file mode 100644
index 00000000..068ea302
--- /dev/null
+++ b/docs/api/methods/remove_chat_verification.rst
@@ -0,0 +1,45 @@
+######################
+removeChatVerification
+######################
+
+Returns: :obj:`bool`
+
+.. automodule:: aiogram.methods.remove_chat_verification
+ :members:
+ :member-order: bysource
+ :undoc-members: True
+ :exclude-members: model_config,model_fields
+
+
+Usage
+=====
+
+As bot method
+-------------
+
+.. code-block::
+
+ result: bool = await bot.remove_chat_verification(...)
+
+
+Method as object
+----------------
+
+Imports:
+
+- :code:`from aiogram.methods.remove_chat_verification import RemoveChatVerification`
+- alias: :code:`from aiogram.methods import RemoveChatVerification`
+
+With specific bot
+~~~~~~~~~~~~~~~~~
+
+.. code-block:: python
+
+ result: bool = await bot(RemoveChatVerification(...))
+
+As reply into Webhook in handler
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: python
+
+ return RemoveChatVerification(...)
diff --git a/docs/api/methods/remove_user_verification.rst b/docs/api/methods/remove_user_verification.rst
new file mode 100644
index 00000000..a122abab
--- /dev/null
+++ b/docs/api/methods/remove_user_verification.rst
@@ -0,0 +1,45 @@
+######################
+removeUserVerification
+######################
+
+Returns: :obj:`bool`
+
+.. automodule:: aiogram.methods.remove_user_verification
+ :members:
+ :member-order: bysource
+ :undoc-members: True
+ :exclude-members: model_config,model_fields
+
+
+Usage
+=====
+
+As bot method
+-------------
+
+.. code-block::
+
+ result: bool = await bot.remove_user_verification(...)
+
+
+Method as object
+----------------
+
+Imports:
+
+- :code:`from aiogram.methods.remove_user_verification import RemoveUserVerification`
+- alias: :code:`from aiogram.methods import RemoveUserVerification`
+
+With specific bot
+~~~~~~~~~~~~~~~~~
+
+.. code-block:: python
+
+ result: bool = await bot(RemoveUserVerification(...))
+
+As reply into Webhook in handler
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: python
+
+ return RemoveUserVerification(...)
diff --git a/docs/api/methods/verify_chat.rst b/docs/api/methods/verify_chat.rst
new file mode 100644
index 00000000..e60a130a
--- /dev/null
+++ b/docs/api/methods/verify_chat.rst
@@ -0,0 +1,45 @@
+##########
+verifyChat
+##########
+
+Returns: :obj:`bool`
+
+.. automodule:: aiogram.methods.verify_chat
+ :members:
+ :member-order: bysource
+ :undoc-members: True
+ :exclude-members: model_config,model_fields
+
+
+Usage
+=====
+
+As bot method
+-------------
+
+.. code-block::
+
+ result: bool = await bot.verify_chat(...)
+
+
+Method as object
+----------------
+
+Imports:
+
+- :code:`from aiogram.methods.verify_chat import VerifyChat`
+- alias: :code:`from aiogram.methods import VerifyChat`
+
+With specific bot
+~~~~~~~~~~~~~~~~~
+
+.. code-block:: python
+
+ result: bool = await bot(VerifyChat(...))
+
+As reply into Webhook in handler
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: python
+
+ return VerifyChat(...)
diff --git a/docs/api/methods/verify_user.rst b/docs/api/methods/verify_user.rst
new file mode 100644
index 00000000..12aa6e3e
--- /dev/null
+++ b/docs/api/methods/verify_user.rst
@@ -0,0 +1,45 @@
+##########
+verifyUser
+##########
+
+Returns: :obj:`bool`
+
+.. automodule:: aiogram.methods.verify_user
+ :members:
+ :member-order: bysource
+ :undoc-members: True
+ :exclude-members: model_config,model_fields
+
+
+Usage
+=====
+
+As bot method
+-------------
+
+.. code-block::
+
+ result: bool = await bot.verify_user(...)
+
+
+Method as object
+----------------
+
+Imports:
+
+- :code:`from aiogram.methods.verify_user import VerifyUser`
+- alias: :code:`from aiogram.methods import VerifyUser`
+
+With specific bot
+~~~~~~~~~~~~~~~~~
+
+.. code-block:: python
+
+ result: bool = await bot(VerifyUser(...))
+
+As reply into Webhook in handler
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: python
+
+ return VerifyUser(...)
diff --git a/tests/test_api/test_client/test_session/test_aiohttp_session.py b/tests/test_api/test_client/test_session/test_aiohttp_session.py
index d382a7cf..bc0239df 100644
--- a/tests/test_api/test_client/test_session/test_aiohttp_session.py
+++ b/tests/test_api/test_client/test_session/test_aiohttp_session.py
@@ -41,7 +41,7 @@ class TestAiohttpSession:
async def test_create_proxy_session(self):
auth = aiohttp.BasicAuth("login", "password", "encoding")
- async with AiohttpSession(proxy=("socks5://proxy.url/", auth)) as session:
+ async with AiohttpSession(proxy=("socks5://proxy.url:1080/", auth)) as session:
assert session._connector_type == aiohttp_socks.ProxyConnector
assert isinstance(session._connector_init, dict)
@@ -51,7 +51,7 @@ class TestAiohttpSession:
assert isinstance(aiohttp_session.connector, aiohttp_socks.ProxyConnector)
async def test_create_proxy_session_proxy_url(self):
- async with AiohttpSession(proxy="socks4://proxy.url/") as session:
+ async with AiohttpSession(proxy="socks4://proxy.url:1080/") as session:
assert isinstance(session.proxy, str)
assert isinstance(session._connector_init, dict)
@@ -62,8 +62,8 @@ class TestAiohttpSession:
async def test_create_proxy_session_chained_proxies(self):
proxy_chain = [
- "socks4://proxy.url/",
- "socks5://proxy.url/",
+ "socks4://proxy.url:1080/",
+ "socks5://proxy.url:1080/",
"http://user:password@127.0.0.1:3128",
]
async with AiohttpSession(proxy=proxy_chain) as session:
@@ -90,7 +90,7 @@ class TestAiohttpSession:
assert session._should_reset_connector is False
assert session.proxy is None
- session.proxy = "socks5://auth:auth@proxy.url/"
+ session.proxy = "socks5://auth:auth@proxy.url:1080/"
assert session._should_reset_connector
await session.create_session()
assert session._should_reset_connector is False
diff --git a/tests/test_api/test_methods/test_remove_chat_verification.py b/tests/test_api/test_methods/test_remove_chat_verification.py
new file mode 100644
index 00000000..29186300
--- /dev/null
+++ b/tests/test_api/test_methods/test_remove_chat_verification.py
@@ -0,0 +1,12 @@
+from aiogram.methods import RemoveChatVerification, VerifyChat
+from aiogram.types import Poll
+from tests.mocked_bot import MockedBot
+
+
+class TestRemoveChatVerification:
+ async def test_bot_method(self, bot: MockedBot):
+ prepare_result = bot.add_result_for(RemoveChatVerification, ok=True, result=True)
+
+ response: bool = await bot.remove_chat_verification(chat_id=42)
+ request = bot.get_request()
+ assert response == prepare_result.result
diff --git a/tests/test_api/test_methods/test_remove_user_verification.py b/tests/test_api/test_methods/test_remove_user_verification.py
new file mode 100644
index 00000000..4d405c82
--- /dev/null
+++ b/tests/test_api/test_methods/test_remove_user_verification.py
@@ -0,0 +1,12 @@
+from aiogram.methods import RemoveUserVerification, VerifyChat
+from aiogram.types import Poll
+from tests.mocked_bot import MockedBot
+
+
+class TestRemoveUserVerification:
+ async def test_bot_method(self, bot: MockedBot):
+ prepare_result = bot.add_result_for(RemoveUserVerification, ok=True, result=True)
+
+ response: bool = await bot.remove_user_verification(user_id=42)
+ request = bot.get_request()
+ assert response == prepare_result.result
diff --git a/tests/test_api/test_methods/test_verify_chat.py b/tests/test_api/test_methods/test_verify_chat.py
new file mode 100644
index 00000000..1473b976
--- /dev/null
+++ b/tests/test_api/test_methods/test_verify_chat.py
@@ -0,0 +1,12 @@
+from aiogram.methods import VerifyChat
+from aiogram.types import Poll
+from tests.mocked_bot import MockedBot
+
+
+class TestVerifyChat:
+ async def test_bot_method(self, bot: MockedBot):
+ prepare_result = bot.add_result_for(VerifyChat, ok=True, result=True)
+
+ response: bool = await bot.verify_chat(chat_id=42)
+ request = bot.get_request()
+ assert response == prepare_result.result
diff --git a/tests/test_api/test_methods/test_verify_user.py b/tests/test_api/test_methods/test_verify_user.py
new file mode 100644
index 00000000..9bb502ca
--- /dev/null
+++ b/tests/test_api/test_methods/test_verify_user.py
@@ -0,0 +1,12 @@
+from aiogram.methods import VerifyChat, VerifyUser
+from aiogram.types import Poll
+from tests.mocked_bot import MockedBot
+
+
+class TestVerifyUser:
+ async def test_bot_method(self, bot: MockedBot):
+ prepare_result = bot.add_result_for(VerifyUser, ok=True, result=True)
+
+ response: bool = await bot.verify_user(user_id=42)
+ request = bot.get_request()
+ assert response == prepare_result.result