mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 10:11:52 +00:00
parent
adfc89f125
commit
247ffbef69
150 changed files with 571 additions and 1112 deletions
|
|
@ -1 +1 @@
|
||||||
6.0
|
6.1
|
||||||
|
|
|
||||||
1
CHANGES/936.misc.rst
Normal file
1
CHANGES/936.misc.rst
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Added full support of `Bot API 6.1 <https://core.telegram.org/bots/api-changelog#june-20-2022>`_
|
||||||
|
|
@ -13,7 +13,7 @@ aiogram |beta badge|
|
||||||
:target: https://pypi.python.org/pypi/aiogram
|
:target: https://pypi.python.org/pypi/aiogram
|
||||||
:alt: Supported python versions
|
:alt: Supported python versions
|
||||||
|
|
||||||
.. image:: https://img.shields.io/badge/Telegram%20Bot%20API-6.0-blue.svg?logo=telegram
|
.. image:: https://img.shields.io/badge/Telegram%20Bot%20API-6.1-blue.svg?logo=telegram
|
||||||
:target: https://core.telegram.org/bots/api
|
:target: https://core.telegram.org/bots/api
|
||||||
:alt: Telegram Bot API
|
:alt: Telegram Bot API
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,5 +39,5 @@ __all__ = (
|
||||||
"flags",
|
"flags",
|
||||||
)
|
)
|
||||||
|
|
||||||
__version__ = "3.0.0b3"
|
__version__ = "3.0.0b4"
|
||||||
__api_version__ = "6.0"
|
__api_version__ = "6.1"
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ from ..methods import (
|
||||||
Close,
|
Close,
|
||||||
CopyMessage,
|
CopyMessage,
|
||||||
CreateChatInviteLink,
|
CreateChatInviteLink,
|
||||||
|
CreateInvoiceLink,
|
||||||
CreateNewStickerSet,
|
CreateNewStickerSet,
|
||||||
DeclineChatJoinRequest,
|
DeclineChatJoinRequest,
|
||||||
DeleteChatPhoto,
|
DeleteChatPhoto,
|
||||||
|
|
@ -413,11 +414,12 @@ class Bot(ContextInstanceMixin["Bot"]):
|
||||||
max_connections: Optional[int] = None,
|
max_connections: Optional[int] = None,
|
||||||
allowed_updates: Optional[List[str]] = None,
|
allowed_updates: Optional[List[str]] = None,
|
||||||
drop_pending_updates: Optional[bool] = None,
|
drop_pending_updates: Optional[bool] = None,
|
||||||
|
secret_token: Optional[str] = None,
|
||||||
request_timeout: Optional[int] = None,
|
request_timeout: Optional[int] = None,
|
||||||
) -> bool:
|
) -> 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, we will give up after a reasonable amount of attempts. Returns :code:`True` on success.
|
||||||
If you'd like to make sure that the Webhook request comes from Telegram, we recommend using a secret path in the URL, e.g. :code:`https://www.example.com/<token>`. Since nobody else knows your bot's token, you can be pretty sure it's us.
|
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**
|
**Notes**
|
||||||
|
|
||||||
|
|
@ -425,17 +427,18 @@ class Bot(ContextInstanceMixin["Bot"]):
|
||||||
|
|
||||||
**2.** To use a self-signed certificate, you need to upload your `public key certificate <https://core.telegram.org/bots/self-signed>`_ using *certificate* parameter. Please upload as InputFile, sending a String will not work.
|
**2.** To use a self-signed certificate, you need to upload your `public key certificate <https://core.telegram.org/bots/self-signed>`_ using *certificate* parameter. Please upload as InputFile, sending a String will not work.
|
||||||
|
|
||||||
**3.** Ports currently supported *for Webhooks*: **443, 80, 88, 8443**.
|
**3.** Ports currently supported *for webhooks*: **443, 80, 88, 8443**.
|
||||||
**NEW!** If you're having any trouble setting up webhooks, please check out this `amazing guide to Webhooks <https://core.telegram.org/bots/webhooks>`_.
|
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
|
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 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 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
|
:param ip_address: The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS
|
||||||
:param max_connections: Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to *40*. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput.
|
:param max_connections: The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to *40*. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput.
|
||||||
:param allowed_updates: A JSON-serialized list of the update types you want your bot to receive. For example, specify ['message', 'edited_channel_post', 'callback_query'] to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member* (default). If not specified, the previous setting will be used.
|
:param allowed_updates: A JSON-serialized list of the update types you want your bot to receive. For example, specify ['message', 'edited_channel_post', 'callback_query'] to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member* (default). If not specified, the previous setting will be used.
|
||||||
:param drop_pending_updates: Pass :code:`True` to drop all pending updates
|
:param drop_pending_updates: Pass :code:`True` to drop all pending updates
|
||||||
|
:param secret_token: A secret token to be sent in a header 'X-Telegram-Bot-Api-Secret-Token' in every webhook request, 1-256 characters. Only characters :code:`A-Z`, :code:`a-z`, :code:`0-9`, :code:`_` and :code:`-` are allowed. The header is useful to ensure that the request comes from a webhook set by you.
|
||||||
:param request_timeout: Request timeout
|
:param request_timeout: Request timeout
|
||||||
:return: Returns True on success.
|
:return: Returns True on success.
|
||||||
"""
|
"""
|
||||||
|
|
@ -446,6 +449,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
||||||
max_connections=max_connections,
|
max_connections=max_connections,
|
||||||
allowed_updates=allowed_updates,
|
allowed_updates=allowed_updates,
|
||||||
drop_pending_updates=drop_pending_updates,
|
drop_pending_updates=drop_pending_updates,
|
||||||
|
secret_token=secret_token,
|
||||||
)
|
)
|
||||||
return await self(call, request_timeout=request_timeout)
|
return await self(call, request_timeout=request_timeout)
|
||||||
|
|
||||||
|
|
@ -687,7 +691,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
||||||
Source: https://core.telegram.org/bots/api#sendphoto
|
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 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 info on Sending Files » <sending-files>`
|
: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 caption: Photo caption (may also be used when resending photos by *file_id*), 0-1024 characters after entities parsing
|
:param caption: Photo caption (may also be used when resending photos by *file_id*), 0-1024 characters after entities parsing
|
||||||
:param parse_mode: Mode for parsing entities in the photo caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
:param parse_mode: Mode for parsing entities in the photo caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
||||||
:param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*
|
:param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*
|
||||||
|
|
@ -740,14 +744,14 @@ class Bot(ContextInstanceMixin["Bot"]):
|
||||||
Source: https://core.telegram.org/bots/api#sendaudio
|
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 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 info on Sending Files » <sending-files>`
|
: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 caption: Audio caption, 0-1024 characters after entities parsing
|
:param caption: Audio caption, 0-1024 characters after entities parsing
|
||||||
:param parse_mode: Mode for parsing entities in the audio caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
:param parse_mode: Mode for parsing entities in the audio caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
||||||
:param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*
|
:param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*
|
||||||
:param duration: Duration of the audio in seconds
|
:param duration: Duration of the audio in seconds
|
||||||
:param performer: Performer
|
:param performer: Performer
|
||||||
:param title: Track name
|
:param title: Track name
|
||||||
:param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More info on Sending Files » <sending-files>`
|
:param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
|
||||||
:param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
|
:param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
|
||||||
:param protect_content: Protects the contents of the sent message from forwarding and saving
|
:param protect_content: Protects the contents of the sent message from forwarding and saving
|
||||||
:param reply_to_message_id: If the message is a reply, ID of the original message
|
:param reply_to_message_id: If the message is a reply, ID of the original message
|
||||||
|
|
@ -798,8 +802,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
||||||
Source: https://core.telegram.org/bots/api#senddocument
|
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 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 info on Sending Files » <sending-files>`
|
: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 thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More info on Sending Files » <sending-files>`
|
:param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
|
||||||
:param caption: Document caption (may also be used when resending documents by *file_id*), 0-1024 characters after entities parsing
|
:param caption: Document caption (may also be used when resending documents by *file_id*), 0-1024 characters after entities parsing
|
||||||
:param parse_mode: Mode for parsing entities in the document caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
:param parse_mode: Mode for parsing entities in the document caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
||||||
:param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*
|
:param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*
|
||||||
|
|
@ -850,16 +854,16 @@ class Bot(ContextInstanceMixin["Bot"]):
|
||||||
request_timeout: Optional[int] = None,
|
request_timeout: Optional[int] = None,
|
||||||
) -> Message:
|
) -> Message:
|
||||||
"""
|
"""
|
||||||
Use this method to send video files, Telegram clients support mp4 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.
|
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
|
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 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 info on Sending Files » <sending-files>`
|
: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 duration: Duration of sent video in seconds
|
:param duration: Duration of sent video in seconds
|
||||||
:param width: Video width
|
:param width: Video width
|
||||||
:param height: Video height
|
:param height: Video height
|
||||||
:param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More info on Sending Files » <sending-files>`
|
:param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
|
||||||
:param caption: Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing
|
:param caption: Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing
|
||||||
:param parse_mode: Mode for parsing entities in the video caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
:param parse_mode: Mode for parsing entities in the video caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
||||||
:param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*
|
:param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*
|
||||||
|
|
@ -917,11 +921,11 @@ class Bot(ContextInstanceMixin["Bot"]):
|
||||||
Source: https://core.telegram.org/bots/api#sendanimation
|
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 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 info on Sending Files » <sending-files>`
|
: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 duration: Duration of sent animation in seconds
|
:param duration: Duration of sent animation in seconds
|
||||||
:param width: Animation width
|
:param width: Animation width
|
||||||
:param height: Animation height
|
:param height: Animation height
|
||||||
:param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More info on Sending Files » <sending-files>`
|
:param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
|
||||||
:param caption: Animation caption (may also be used when resending animation by *file_id*), 0-1024 characters after entities parsing
|
:param caption: Animation caption (may also be used when resending animation by *file_id*), 0-1024 characters after entities parsing
|
||||||
:param parse_mode: Mode for parsing entities in the animation caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
:param parse_mode: Mode for parsing entities in the animation caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
||||||
:param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*
|
:param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*
|
||||||
|
|
@ -974,7 +978,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
||||||
Source: https://core.telegram.org/bots/api#sendvoice
|
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 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 info on Sending Files » <sending-files>`
|
: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 caption: Voice message caption, 0-1024 characters after entities parsing
|
:param caption: Voice message caption, 0-1024 characters after entities parsing
|
||||||
:param parse_mode: Mode for parsing entities in the voice message caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
:param parse_mode: Mode for parsing entities in the voice message caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
||||||
:param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*
|
:param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*
|
||||||
|
|
@ -1019,15 +1023,15 @@ class Bot(ContextInstanceMixin["Bot"]):
|
||||||
request_timeout: Optional[int] = None,
|
request_timeout: Optional[int] = None,
|
||||||
) -> Message:
|
) -> Message:
|
||||||
"""
|
"""
|
||||||
As of `v.4.0 <https://telegram.org/blog/video-messages-and-telescope>`_, Telegram clients support rounded square mp4 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.
|
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
|
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 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 info on Sending Files » <sending-files>`. Sending video notes by a URL is currently unsupported
|
: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 duration: Duration of sent video in seconds
|
:param duration: Duration of sent video in seconds
|
||||||
:param length: Video width and height, i.e. diameter of the video message
|
:param length: Video width and height, i.e. diameter of the video message
|
||||||
:param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More info on Sending Files » <sending-files>`
|
:param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
|
||||||
:param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
|
:param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
|
||||||
:param protect_content: Protects the contents of the sent message from forwarding and saving
|
:param protect_content: Protects the contents of the sent message from forwarding and saving
|
||||||
:param reply_to_message_id: If the message is a reply, ID of the original message
|
:param reply_to_message_id: If the message is a reply, ID of the original message
|
||||||
|
|
@ -1163,7 +1167,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
||||||
:param inline_message_id: Required if *chat_id* and *message_id* are not specified. Identifier of the inline message
|
:param inline_message_id: Required if *chat_id* and *message_id* are not specified. Identifier of the inline message
|
||||||
:param horizontal_accuracy: The radius of uncertainty for the location, measured in meters; 0-1500
|
:param horizontal_accuracy: The radius of uncertainty for the location, measured in meters; 0-1500
|
||||||
:param heading: Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
|
:param heading: Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
|
||||||
:param proximity_alert_radius: Maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
|
:param proximity_alert_radius: The maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
|
||||||
:param reply_markup: A JSON-serialized object for a new `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_.
|
:param reply_markup: A JSON-serialized object for a new `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_.
|
||||||
:param request_timeout: Request timeout
|
:param request_timeout: Request timeout
|
||||||
:return: On success, if the edited message is not an inline message, the edited Message is
|
:return: On success, if the edited message is not an inline message, the edited Message is
|
||||||
|
|
@ -1487,12 +1491,12 @@ class Bot(ContextInstanceMixin["Bot"]):
|
||||||
request_timeout: Optional[int] = None,
|
request_timeout: Optional[int] = None,
|
||||||
) -> File:
|
) -> File:
|
||||||
"""
|
"""
|
||||||
Use this method to get basic info 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.
|
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.
|
**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
|
Source: https://core.telegram.org/bots/api#getfile
|
||||||
|
|
||||||
:param file_id: File identifier to get info about
|
:param file_id: File identifier to get information about
|
||||||
:param request_timeout: Request timeout
|
:param request_timeout: Request timeout
|
||||||
:return: On success, a File object is returned.
|
:return: On success, a File object is returned.
|
||||||
"""
|
"""
|
||||||
|
|
@ -1801,7 +1805,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
||||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
: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 name: Invite link name; 0-32 characters
|
||||||
:param expire_date: Point in time (Unix timestamp) when the link will expire
|
:param expire_date: Point in time (Unix timestamp) when the link will expire
|
||||||
:param member_limit: Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
|
:param member_limit: The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
|
||||||
:param creates_join_request: :code:`True`, if users joining the chat via the link need to be approved by chat administrators. If :code:`True`, *member_limit* can't be specified
|
:param creates_join_request: :code:`True`, if users joining the chat via the link need to be approved by chat administrators. If :code:`True`, *member_limit* can't be specified
|
||||||
:param request_timeout: Request timeout
|
:param request_timeout: Request timeout
|
||||||
:return: Returns the new invite link as ChatInviteLink object.
|
:return: Returns the new invite link as ChatInviteLink object.
|
||||||
|
|
@ -1834,7 +1838,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
||||||
:param invite_link: The invite link to edit
|
:param invite_link: The invite link to edit
|
||||||
:param name: Invite link name; 0-32 characters
|
:param name: Invite link name; 0-32 characters
|
||||||
:param expire_date: Point in time (Unix timestamp) when the link will expire
|
:param expire_date: Point in time (Unix timestamp) when the link will expire
|
||||||
:param member_limit: Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
|
:param member_limit: The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
|
||||||
:param creates_join_request: :code:`True`, if users joining the chat via the link need to be approved by chat administrators. If :code:`True`, *member_limit* can't be specified
|
:param creates_join_request: :code:`True`, if users joining the chat via the link need to be approved by chat administrators. If :code:`True`, *member_limit* can't be specified
|
||||||
:param request_timeout: Request timeout
|
:param request_timeout: Request timeout
|
||||||
:return: Returns the edited invite link as a ChatInviteLink object.
|
:return: Returns the edited invite link as a ChatInviteLink object.
|
||||||
|
|
@ -2261,14 +2265,14 @@ class Bot(ContextInstanceMixin["Bot"]):
|
||||||
"""
|
"""
|
||||||
Use this method to send answers to callback queries sent from `inline keyboards <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, :code:`True` is returned.
|
Use this method to send answers to callback queries sent from `inline keyboards <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, :code:`True` is returned.
|
||||||
|
|
||||||
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.
|
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
|
Source: https://core.telegram.org/bots/api#answercallbackquery
|
||||||
|
|
||||||
:param callback_query_id: Unique identifier for the query to be answered
|
: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 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*.
|
: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*.
|
||||||
:param url: URL that will be opened by the user's client. If you have created a :class:`aiogram.types.game.Game` and accepted the conditions via `@Botfather <https://t.me/botfather>`_, specify the URL that opens your game — note that this will only work if the query comes from a `https://core.telegram.org/bots/api#inlinekeyboardbutton <https://core.telegram.org/bots/api#inlinekeyboardbutton>`_ *callback_game* button.
|
:param url: URL that will be opened by the user's client. If you have created a :class:`aiogram.types.game.Game` and accepted the conditions via `@BotFather <https://t.me/botfather>`_, specify the URL that opens your game - note that this will only work if the query comes from a `https://core.telegram.org/bots/api#inlinekeyboardbutton <https://core.telegram.org/bots/api#inlinekeyboardbutton>`_ *callback_game* button.
|
||||||
:param cache_time: The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0.
|
:param cache_time: The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0.
|
||||||
:param request_timeout: Request timeout
|
:param request_timeout: Request timeout
|
||||||
:return: On success, True is returned.
|
:return: On success, True is returned.
|
||||||
|
|
@ -2364,7 +2368,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
||||||
Source: https://core.telegram.org/bots/api#setchatmenubutton
|
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 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 new bot's menu button. Defaults to :class:`aiogram.types.menu_button_default.MenuButtonDefault`
|
: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
|
:param request_timeout: Request timeout
|
||||||
:return: Returns True on success.
|
:return: Returns True on success.
|
||||||
"""
|
"""
|
||||||
|
|
@ -2666,7 +2670,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
||||||
Source: https://core.telegram.org/bots/api#sendsticker
|
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 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 info on Sending Files » <sending-files>`
|
: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 disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
|
:param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
|
||||||
:param protect_content: Protects the contents of the sent message from forwarding and saving
|
:param protect_content: Protects the contents of the sent message from forwarding and saving
|
||||||
:param reply_to_message_id: If the message is a reply, ID of the original message
|
:param reply_to_message_id: If the message is a reply, ID of the original message
|
||||||
|
|
@ -2717,7 +2721,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
||||||
Source: https://core.telegram.org/bots/api#uploadstickerfile
|
Source: https://core.telegram.org/bots/api#uploadstickerfile
|
||||||
|
|
||||||
:param user_id: User identifier of sticker file owner
|
: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 info on Sending Files » <sending-files>`
|
: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
|
:param request_timeout: Request timeout
|
||||||
:return: Returns the uploaded File on success.
|
:return: Returns the uploaded File on success.
|
||||||
"""
|
"""
|
||||||
|
|
@ -2746,10 +2750,10 @@ class Bot(ContextInstanceMixin["Bot"]):
|
||||||
Source: https://core.telegram.org/bots/api#createnewstickerset
|
Source: https://core.telegram.org/bots/api#createnewstickerset
|
||||||
|
|
||||||
:param user_id: User identifier of created sticker set owner
|
: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 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
|
:param title: Sticker set title, 1-64 characters
|
||||||
:param emojis: One or more emoji corresponding to the sticker
|
:param emojis: One or more emoji corresponding to the sticker
|
||||||
: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. 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 info on Sending Files » <sending-files>`
|
: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. 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>`
|
||||||
:param tgs_sticker: **TGS** animation with the sticker, uploaded using multipart/form-data. 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 technical requirements
|
:param tgs_sticker: **TGS** animation with the sticker, uploaded using multipart/form-data. 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 technical requirements
|
||||||
:param webm_sticker: **WEBM** video with the sticker, uploaded using multipart/form-data. 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 technical requirements
|
:param webm_sticker: **WEBM** video with the sticker, uploaded using multipart/form-data. 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 technical requirements
|
||||||
:param contains_masks: Pass :code:`True`, if a set of mask stickers should be created
|
:param contains_masks: Pass :code:`True`, if a set of mask stickers should be created
|
||||||
|
|
@ -2789,7 +2793,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
||||||
:param user_id: User identifier of sticker set owner
|
:param user_id: User identifier of sticker set owner
|
||||||
:param name: Sticker set name
|
:param name: Sticker set name
|
||||||
:param emojis: One or more emoji corresponding to the sticker
|
:param emojis: One or more emoji corresponding to the sticker
|
||||||
: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. 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 info on Sending Files » <sending-files>`
|
: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. 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>`
|
||||||
:param tgs_sticker: **TGS** animation with the sticker, uploaded using multipart/form-data. 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 technical requirements
|
:param tgs_sticker: **TGS** animation with the sticker, uploaded using multipart/form-data. 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 technical requirements
|
||||||
:param webm_sticker: **WEBM** video with the sticker, uploaded using multipart/form-data. 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 technical requirements
|
:param webm_sticker: **WEBM** video with the sticker, uploaded using multipart/form-data. 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 technical requirements
|
||||||
:param mask_position: A JSON-serialized object for position where the mask should be placed on faces
|
:param mask_position: A JSON-serialized object for position where the mask should be placed on faces
|
||||||
|
|
@ -2862,7 +2866,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
||||||
|
|
||||||
:param name: Sticker set name
|
:param name: Sticker set name
|
||||||
:param user_id: User identifier of the sticker set owner
|
: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 info on Sending Files » <sending-files>`. Animated sticker set thumbnails can't be uploaded via HTTP URL.
|
: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.
|
||||||
:param request_timeout: Request timeout
|
:param request_timeout: Request timeout
|
||||||
:return: Returns True on success.
|
:return: Returns True on success.
|
||||||
"""
|
"""
|
||||||
|
|
@ -2984,23 +2988,23 @@ class Bot(ContextInstanceMixin["Bot"]):
|
||||||
:param title: Product name, 1-32 characters
|
:param title: Product name, 1-32 characters
|
||||||
:param description: Product description, 1-255 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.
|
:param payload: Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.
|
||||||
:param provider_token: Payments provider token, obtained via `Botfather <https://t.me/botfather>`_
|
:param provider_token: Payment provider token, obtained via `@BotFather <https://t.me/botfather>`_
|
||||||
:param currency: Three-letter ISO 4217 currency code, see `more on currencies <https://core.telegram.org/bots/payments#supported-currencies>`_
|
:param currency: Three-letter ISO 4217 currency code, see `more on currencies <https://core.telegram.org/bots/payments#supported-currencies>`_
|
||||||
:param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
|
:param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
|
||||||
:param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json <https://core.telegram.org/bots/payments/currencies.json>`_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0
|
:param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json <https://core.telegram.org/bots/payments/currencies.json>`_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0
|
||||||
:param suggested_tip_amounts: A JSON-serialized array of suggested amounts of tips in the *smallest units* of the currency (integer, **not** float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed *max_tip_amount*.
|
:param suggested_tip_amounts: A JSON-serialized array of suggested amounts of tips in the *smallest units* of the currency (integer, **not** float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed *max_tip_amount*.
|
||||||
:param start_parameter: Unique deep-linking parameter. If left empty, **forwarded copies** of the sent message will have a *Pay* button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a *URL* button with a deep link to the bot (instead of a *Pay* button), with the value used as the start parameter
|
:param start_parameter: Unique deep-linking parameter. If left empty, **forwarded copies** of the sent message will have a *Pay* button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a *URL* button with a deep link to the bot (instead of a *Pay* button), with the value used as the start parameter
|
||||||
:param provider_data: A JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.
|
:param provider_data: JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.
|
||||||
:param photo_url: URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for.
|
:param photo_url: URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for.
|
||||||
:param photo_size: Photo size
|
:param photo_size: Photo size in bytes
|
||||||
:param photo_width: Photo width
|
:param photo_width: Photo width
|
||||||
:param photo_height: Photo height
|
:param photo_height: Photo height
|
||||||
:param need_name: Pass :code:`True`, if you require the user's full name to complete the order
|
:param need_name: Pass :code:`True`, if you require the user's full name to complete the order
|
||||||
:param need_phone_number: Pass :code:`True`, if you require the user's phone number to complete the order
|
:param need_phone_number: Pass :code:`True`, if you require the user's phone number to complete the order
|
||||||
:param need_email: Pass :code:`True`, if you require the user's email address to complete the order
|
:param need_email: Pass :code:`True`, if you require the user's email address to complete the order
|
||||||
:param need_shipping_address: Pass :code:`True`, if you require the user's shipping address to complete the order
|
:param need_shipping_address: Pass :code:`True`, if you require the user's shipping address to complete the order
|
||||||
:param send_phone_number_to_provider: Pass :code:`True`, if user's phone number should be sent to provider
|
:param send_phone_number_to_provider: Pass :code:`True`, if the user's phone number should be sent to provider
|
||||||
:param send_email_to_provider: Pass :code:`True`, if user's email address should be sent to provider
|
:param send_email_to_provider: Pass :code:`True`, if the user's email address should be sent to provider
|
||||||
:param is_flexible: Pass :code:`True`, if the final price depends on the shipping method
|
:param is_flexible: Pass :code:`True`, if the final price depends on the shipping method
|
||||||
:param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
|
:param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
|
||||||
:param protect_content: Protects the contents of the sent message from forwarding and saving
|
:param protect_content: Protects the contents of the sent message from forwarding and saving
|
||||||
|
|
@ -3041,6 +3045,82 @@ class Bot(ContextInstanceMixin["Bot"]):
|
||||||
)
|
)
|
||||||
return await self(call, request_timeout=request_timeout)
|
return await self(call, request_timeout=request_timeout)
|
||||||
|
|
||||||
|
async def create_invoice_link(
|
||||||
|
self,
|
||||||
|
title: str,
|
||||||
|
description: str,
|
||||||
|
payload: str,
|
||||||
|
provider_token: str,
|
||||||
|
currency: str,
|
||||||
|
prices: List[LabeledPrice],
|
||||||
|
max_tip_amount: Optional[int] = None,
|
||||||
|
suggested_tip_amounts: Optional[List[int]] = None,
|
||||||
|
provider_data: Optional[str] = None,
|
||||||
|
photo_url: Optional[str] = None,
|
||||||
|
photo_size: Optional[int] = None,
|
||||||
|
photo_width: Optional[int] = None,
|
||||||
|
photo_height: Optional[int] = None,
|
||||||
|
need_name: Optional[bool] = None,
|
||||||
|
need_phone_number: Optional[bool] = None,
|
||||||
|
need_email: Optional[bool] = None,
|
||||||
|
need_shipping_address: Optional[bool] = None,
|
||||||
|
send_phone_number_to_provider: Optional[bool] = None,
|
||||||
|
send_email_to_provider: Optional[bool] = None,
|
||||||
|
is_flexible: Optional[bool] = None,
|
||||||
|
request_timeout: Optional[int] = None,
|
||||||
|
) -> str:
|
||||||
|
"""
|
||||||
|
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.
|
||||||
|
:param provider_token: Payment provider token, obtained via `BotFather <https://t.me/botfather>`_
|
||||||
|
:param currency: Three-letter ISO 4217 currency code, see `more on currencies <https://core.telegram.org/bots/payments#supported-currencies>`_
|
||||||
|
:param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
|
||||||
|
:param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json <https://core.telegram.org/bots/payments/currencies.json>`_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0
|
||||||
|
:param suggested_tip_amounts: A JSON-serialized array of suggested amounts of tips in the *smallest units* of the currency (integer, **not** float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed *max_tip_amount*.
|
||||||
|
:param provider_data: JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.
|
||||||
|
:param photo_url: URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service.
|
||||||
|
:param photo_size: Photo size in bytes
|
||||||
|
:param photo_width: Photo width
|
||||||
|
:param photo_height: Photo height
|
||||||
|
:param need_name: Pass :code:`True`, if you require the user's full name to complete the order
|
||||||
|
:param need_phone_number: Pass :code:`True`, if you require the user's phone number to complete the order
|
||||||
|
:param need_email: Pass :code:`True`, if you require the user's email address to complete the order
|
||||||
|
:param need_shipping_address: Pass :code:`True`, if you require the user's shipping address to complete the order
|
||||||
|
:param send_phone_number_to_provider: Pass :code:`True`, if the user's phone number should be sent to the provider
|
||||||
|
:param send_email_to_provider: Pass :code:`True`, if the user's email address should be sent to the provider
|
||||||
|
:param is_flexible: Pass :code:`True`, if the final price depends on the shipping method
|
||||||
|
:param request_timeout: Request timeout
|
||||||
|
:return: Returns the created invoice link as String on success.
|
||||||
|
"""
|
||||||
|
call = CreateInvoiceLink(
|
||||||
|
title=title,
|
||||||
|
description=description,
|
||||||
|
payload=payload,
|
||||||
|
provider_token=provider_token,
|
||||||
|
currency=currency,
|
||||||
|
prices=prices,
|
||||||
|
max_tip_amount=max_tip_amount,
|
||||||
|
suggested_tip_amounts=suggested_tip_amounts,
|
||||||
|
provider_data=provider_data,
|
||||||
|
photo_url=photo_url,
|
||||||
|
photo_size=photo_size,
|
||||||
|
photo_width=photo_width,
|
||||||
|
photo_height=photo_height,
|
||||||
|
need_name=need_name,
|
||||||
|
need_phone_number=need_phone_number,
|
||||||
|
need_email=need_email,
|
||||||
|
need_shipping_address=need_shipping_address,
|
||||||
|
send_phone_number_to_provider=send_phone_number_to_provider,
|
||||||
|
send_email_to_provider=send_email_to_provider,
|
||||||
|
is_flexible=is_flexible,
|
||||||
|
)
|
||||||
|
return await self(call, request_timeout=request_timeout)
|
||||||
|
|
||||||
async def answer_shipping_query(
|
async def answer_shipping_query(
|
||||||
self,
|
self,
|
||||||
shipping_query_id: str,
|
shipping_query_id: str,
|
||||||
|
|
@ -3146,7 +3226,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
||||||
Source: https://core.telegram.org/bots/api#sendgame
|
Source: https://core.telegram.org/bots/api#sendgame
|
||||||
|
|
||||||
:param chat_id: Unique identifier for the target chat
|
: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 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 disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
|
:param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
|
||||||
:param protect_content: Protects the contents of the sent message from forwarding and saving
|
:param protect_content: Protects the contents of the sent message from forwarding and saving
|
||||||
:param reply_to_message_id: If the message is a reply, ID of the original message
|
:param reply_to_message_id: If the message is a reply, ID of the original message
|
||||||
|
|
@ -3216,7 +3296,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
||||||
"""
|
"""
|
||||||
Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. On success, returns an *Array* of :class:`aiogram.types.game_high_score.GameHighScore` objects.
|
Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. On success, returns an *Array* of :class:`aiogram.types.game_high_score.GameHighScore` objects.
|
||||||
|
|
||||||
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 his neighbors are not among them. Please note that this behavior is subject to change.
|
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
|
Source: https://core.telegram.org/bots/api#getgamehighscores
|
||||||
|
|
||||||
|
|
@ -3228,8 +3308,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
||||||
:return: Will return the score of the specified user and several of their neighbors in a
|
:return: Will return the score of the specified user and several of their neighbors in a
|
||||||
game. On success, returns an Array of GameHighScore objects. This method will
|
game. On success, returns an Array of GameHighScore objects. This method will
|
||||||
currently return scores for the target user, plus two of their closest neighbors
|
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 his neighbors
|
on each side. Will also return the top three users if the user and their
|
||||||
are not among them.
|
neighbors are not among them.
|
||||||
"""
|
"""
|
||||||
call = GetGameHighScores(
|
call = GetGameHighScores(
|
||||||
user_id=user_id,
|
user_id=user_id,
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ from .base import Request, Response, TelegramMethod
|
||||||
from .close import Close
|
from .close import Close
|
||||||
from .copy_message import CopyMessage
|
from .copy_message import CopyMessage
|
||||||
from .create_chat_invite_link import CreateChatInviteLink
|
from .create_chat_invite_link import CreateChatInviteLink
|
||||||
|
from .create_invoice_link import CreateInvoiceLink
|
||||||
from .create_new_sticker_set import CreateNewStickerSet
|
from .create_new_sticker_set import CreateNewStickerSet
|
||||||
from .decline_chat_join_request import DeclineChatJoinRequest
|
from .decline_chat_join_request import DeclineChatJoinRequest
|
||||||
from .delete_chat_photo import DeleteChatPhoto
|
from .delete_chat_photo import DeleteChatPhoto
|
||||||
|
|
@ -176,6 +177,7 @@ __all__ = (
|
||||||
"AnswerInlineQuery",
|
"AnswerInlineQuery",
|
||||||
"AnswerWebAppQuery",
|
"AnswerWebAppQuery",
|
||||||
"SendInvoice",
|
"SendInvoice",
|
||||||
|
"CreateInvoiceLink",
|
||||||
"AnswerShippingQuery",
|
"AnswerShippingQuery",
|
||||||
"AnswerPreCheckoutQuery",
|
"AnswerPreCheckoutQuery",
|
||||||
"SetPassportDataErrors",
|
"SetPassportDataErrors",
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ class AddStickerToSet(TelegramMethod[bool]):
|
||||||
emojis: str
|
emojis: str
|
||||||
"""One or more emoji corresponding to the sticker"""
|
"""One or more emoji corresponding to the sticker"""
|
||||||
png_sticker: Optional[Union[InputFile, str]] = None
|
png_sticker: Optional[Union[InputFile, str]] = None
|
||||||
"""**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. 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 info on Sending Files » <sending-files>`"""
|
"""**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. 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>`"""
|
||||||
tgs_sticker: Optional[InputFile] = None
|
tgs_sticker: Optional[InputFile] = None
|
||||||
"""**TGS** animation with the sticker, uploaded using multipart/form-data. 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 technical requirements"""
|
"""**TGS** animation with the sticker, uploaded using multipart/form-data. 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 technical requirements"""
|
||||||
webm_sticker: Optional[InputFile] = None
|
webm_sticker: Optional[InputFile] = None
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ class AnswerCallbackQuery(TelegramMethod[bool]):
|
||||||
"""
|
"""
|
||||||
Use this method to send answers to callback queries sent from `inline keyboards <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, :code:`True` is returned.
|
Use this method to send answers to callback queries sent from `inline keyboards <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, :code:`True` is returned.
|
||||||
|
|
||||||
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.
|
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
|
Source: https://core.telegram.org/bots/api#answercallbackquery
|
||||||
"""
|
"""
|
||||||
|
|
@ -26,7 +26,7 @@ class AnswerCallbackQuery(TelegramMethod[bool]):
|
||||||
show_alert: Optional[bool] = None
|
show_alert: Optional[bool] = None
|
||||||
"""If :code:`True`, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to *false*."""
|
"""If :code:`True`, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to *false*."""
|
||||||
url: Optional[str] = None
|
url: Optional[str] = None
|
||||||
"""URL that will be opened by the user's client. If you have created a :class:`aiogram.types.game.Game` and accepted the conditions via `@Botfather <https://t.me/botfather>`_, specify the URL that opens your game — note that this will only work if the query comes from a `https://core.telegram.org/bots/api#inlinekeyboardbutton <https://core.telegram.org/bots/api#inlinekeyboardbutton>`_ *callback_game* button."""
|
"""URL that will be opened by the user's client. If you have created a :class:`aiogram.types.game.Game` and accepted the conditions via `@BotFather <https://t.me/botfather>`_, specify the URL that opens your game - note that this will only work if the query comes from a `https://core.telegram.org/bots/api#inlinekeyboardbutton <https://core.telegram.org/bots/api#inlinekeyboardbutton>`_ *callback_game* button."""
|
||||||
cache_time: Optional[int] = None
|
cache_time: Optional[int] = None
|
||||||
"""The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0."""
|
"""The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0."""
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,9 @@ class AnswerWebAppQuery(TelegramMethod[SentWebAppMessage]):
|
||||||
|
|
||||||
def build_request(self, bot: Bot) -> Request:
|
def build_request(self, bot: Bot) -> Request:
|
||||||
data: Dict[str, Any] = self.dict()
|
data: Dict[str, Any] = self.dict()
|
||||||
|
|
||||||
prepare_parse_mode(
|
prepare_parse_mode(
|
||||||
bot, data["result"], parse_mode_property="parse_mode", entities_property="entities"
|
bot, data["result"], parse_mode_property="parse_mode", entities_property="entities"
|
||||||
)
|
)
|
||||||
|
|
||||||
return Request(method="answerWebAppQuery", data=data)
|
return Request(method="answerWebAppQuery", data=data)
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ class CreateChatInviteLink(TelegramMethod[ChatInviteLink]):
|
||||||
expire_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None
|
expire_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None
|
||||||
"""Point in time (Unix timestamp) when the link will expire"""
|
"""Point in time (Unix timestamp) when the link will expire"""
|
||||||
member_limit: Optional[int] = None
|
member_limit: Optional[int] = None
|
||||||
"""Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999"""
|
"""The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999"""
|
||||||
creates_join_request: Optional[bool] = None
|
creates_join_request: Optional[bool] = None
|
||||||
""":code:`True`, if users joining the chat via the link need to be approved by chat administrators. If :code:`True`, *member_limit* can't be specified"""
|
""":code:`True`, if users joining the chat via the link need to be approved by chat administrators. If :code:`True`, *member_limit* can't be specified"""
|
||||||
|
|
||||||
|
|
|
||||||
65
aiogram/methods/create_invoice_link.py
Normal file
65
aiogram/methods/create_invoice_link.py
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING, Any, Dict, List, Optional
|
||||||
|
|
||||||
|
from ..types import LabeledPrice
|
||||||
|
from .base import Request, TelegramMethod
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from ..client.bot import Bot
|
||||||
|
|
||||||
|
|
||||||
|
class CreateInvoiceLink(TelegramMethod[str]):
|
||||||
|
"""
|
||||||
|
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
|
||||||
|
"""
|
||||||
|
|
||||||
|
__returning__ = str
|
||||||
|
|
||||||
|
title: str
|
||||||
|
"""Product name, 1-32 characters"""
|
||||||
|
description: str
|
||||||
|
"""Product description, 1-255 characters"""
|
||||||
|
payload: str
|
||||||
|
"""Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes."""
|
||||||
|
provider_token: str
|
||||||
|
"""Payment provider token, obtained via `BotFather <https://t.me/botfather>`_"""
|
||||||
|
currency: str
|
||||||
|
"""Three-letter ISO 4217 currency code, see `more on currencies <https://core.telegram.org/bots/payments#supported-currencies>`_"""
|
||||||
|
prices: List[LabeledPrice]
|
||||||
|
"""Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)"""
|
||||||
|
max_tip_amount: Optional[int] = None
|
||||||
|
"""The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json <https://core.telegram.org/bots/payments/currencies.json>`_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0"""
|
||||||
|
suggested_tip_amounts: Optional[List[int]] = None
|
||||||
|
"""A JSON-serialized array of suggested amounts of tips in the *smallest units* of the currency (integer, **not** float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed *max_tip_amount*."""
|
||||||
|
provider_data: Optional[str] = None
|
||||||
|
"""JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider."""
|
||||||
|
photo_url: Optional[str] = None
|
||||||
|
"""URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service."""
|
||||||
|
photo_size: Optional[int] = None
|
||||||
|
"""Photo size in bytes"""
|
||||||
|
photo_width: Optional[int] = None
|
||||||
|
"""Photo width"""
|
||||||
|
photo_height: Optional[int] = None
|
||||||
|
"""Photo height"""
|
||||||
|
need_name: Optional[bool] = None
|
||||||
|
"""Pass :code:`True`, if you require the user's full name to complete the order"""
|
||||||
|
need_phone_number: Optional[bool] = None
|
||||||
|
"""Pass :code:`True`, if you require the user's phone number to complete the order"""
|
||||||
|
need_email: Optional[bool] = None
|
||||||
|
"""Pass :code:`True`, if you require the user's email address to complete the order"""
|
||||||
|
need_shipping_address: Optional[bool] = None
|
||||||
|
"""Pass :code:`True`, if you require the user's shipping address to complete the order"""
|
||||||
|
send_phone_number_to_provider: Optional[bool] = None
|
||||||
|
"""Pass :code:`True`, if the user's phone number should be sent to the provider"""
|
||||||
|
send_email_to_provider: Optional[bool] = None
|
||||||
|
"""Pass :code:`True`, if the user's email address should be sent to the provider"""
|
||||||
|
is_flexible: Optional[bool] = None
|
||||||
|
"""Pass :code:`True`, if the final price depends on the shipping method"""
|
||||||
|
|
||||||
|
def build_request(self, bot: Bot) -> Request:
|
||||||
|
data: Dict[str, Any] = self.dict()
|
||||||
|
|
||||||
|
return Request(method="createInvoiceLink", data=data)
|
||||||
|
|
@ -21,13 +21,13 @@ class CreateNewStickerSet(TelegramMethod[bool]):
|
||||||
user_id: int
|
user_id: int
|
||||||
"""User identifier of created sticker set owner"""
|
"""User identifier of created sticker set owner"""
|
||||||
name: str
|
name: str
|
||||||
"""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."""
|
"""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."""
|
||||||
title: str
|
title: str
|
||||||
"""Sticker set title, 1-64 characters"""
|
"""Sticker set title, 1-64 characters"""
|
||||||
emojis: str
|
emojis: str
|
||||||
"""One or more emoji corresponding to the sticker"""
|
"""One or more emoji corresponding to the sticker"""
|
||||||
png_sticker: Optional[Union[InputFile, str]] = None
|
png_sticker: Optional[Union[InputFile, str]] = None
|
||||||
"""**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. 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 info on Sending Files » <sending-files>`"""
|
"""**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. 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>`"""
|
||||||
tgs_sticker: Optional[InputFile] = None
|
tgs_sticker: Optional[InputFile] = None
|
||||||
"""**TGS** animation with the sticker, uploaded using multipart/form-data. 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 technical requirements"""
|
"""**TGS** animation with the sticker, uploaded using multipart/form-data. 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 technical requirements"""
|
||||||
webm_sticker: Optional[InputFile] = None
|
webm_sticker: Optional[InputFile] = None
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ class EditChatInviteLink(TelegramMethod[ChatInviteLink]):
|
||||||
expire_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None
|
expire_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None
|
||||||
"""Point in time (Unix timestamp) when the link will expire"""
|
"""Point in time (Unix timestamp) when the link will expire"""
|
||||||
member_limit: Optional[int] = None
|
member_limit: Optional[int] = None
|
||||||
"""Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999"""
|
"""The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999"""
|
||||||
creates_join_request: Optional[bool] = None
|
creates_join_request: Optional[bool] = None
|
||||||
""":code:`True`, if users joining the chat via the link need to be approved by chat administrators. If :code:`True`, *member_limit* can't be specified"""
|
""":code:`True`, if users joining the chat via the link need to be approved by chat administrators. If :code:`True`, *member_limit* can't be specified"""
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ class EditMessageLiveLocation(TelegramMethod[Union[Message, bool]]):
|
||||||
heading: Optional[int] = None
|
heading: Optional[int] = None
|
||||||
"""Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified."""
|
"""Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified."""
|
||||||
proximity_alert_radius: Optional[int] = None
|
proximity_alert_radius: Optional[int] = None
|
||||||
"""Maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified."""
|
"""The maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified."""
|
||||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||||
"""A JSON-serialized object for a new `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_."""
|
"""A JSON-serialized object for a new `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_."""
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ if TYPE_CHECKING:
|
||||||
|
|
||||||
class GetFile(TelegramMethod[File]):
|
class GetFile(TelegramMethod[File]):
|
||||||
"""
|
"""
|
||||||
Use this method to get basic info 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.
|
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.
|
**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
|
Source: https://core.telegram.org/bots/api#getfile
|
||||||
|
|
@ -20,7 +20,7 @@ class GetFile(TelegramMethod[File]):
|
||||||
__returning__ = File
|
__returning__ = File
|
||||||
|
|
||||||
file_id: str
|
file_id: str
|
||||||
"""File identifier to get info about"""
|
"""File identifier to get information about"""
|
||||||
|
|
||||||
def build_request(self, bot: Bot) -> Request:
|
def build_request(self, bot: Bot) -> Request:
|
||||||
data: Dict[str, Any] = self.dict()
|
data: Dict[str, Any] = self.dict()
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ class GetGameHighScores(TelegramMethod[List[GameHighScore]]):
|
||||||
"""
|
"""
|
||||||
Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. On success, returns an *Array* of :class:`aiogram.types.game_high_score.GameHighScore` objects.
|
Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. On success, returns an *Array* of :class:`aiogram.types.game_high_score.GameHighScore` objects.
|
||||||
|
|
||||||
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 his neighbors are not among them. Please note that this behavior is subject to change.
|
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
|
Source: https://core.telegram.org/bots/api#getgamehighscores
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ class SendAnimation(TelegramMethod[Message]):
|
||||||
chat_id: Union[int, str]
|
chat_id: Union[int, str]
|
||||||
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
||||||
animation: Union[InputFile, str]
|
animation: Union[InputFile, str]
|
||||||
"""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 info on Sending Files » <sending-files>`"""
|
"""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>`"""
|
||||||
duration: Optional[int] = None
|
duration: Optional[int] = None
|
||||||
"""Duration of sent animation in seconds"""
|
"""Duration of sent animation in seconds"""
|
||||||
width: Optional[int] = None
|
width: Optional[int] = None
|
||||||
|
|
@ -38,7 +38,7 @@ class SendAnimation(TelegramMethod[Message]):
|
||||||
height: Optional[int] = None
|
height: Optional[int] = None
|
||||||
"""Animation height"""
|
"""Animation height"""
|
||||||
thumb: Optional[Union[InputFile, str]] = None
|
thumb: Optional[Union[InputFile, str]] = None
|
||||||
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More info on Sending Files » <sending-files>`"""
|
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
|
||||||
caption: Optional[str] = None
|
caption: Optional[str] = None
|
||||||
"""Animation caption (may also be used when resending animation by *file_id*), 0-1024 characters after entities parsing"""
|
"""Animation caption (may also be used when resending animation by *file_id*), 0-1024 characters after entities parsing"""
|
||||||
parse_mode: Optional[str] = UNSET
|
parse_mode: Optional[str] = UNSET
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ class SendAudio(TelegramMethod[Message]):
|
||||||
chat_id: Union[int, str]
|
chat_id: Union[int, str]
|
||||||
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
||||||
audio: Union[InputFile, str]
|
audio: Union[InputFile, str]
|
||||||
"""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 info on Sending Files » <sending-files>`"""
|
"""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>`"""
|
||||||
caption: Optional[str] = None
|
caption: Optional[str] = None
|
||||||
"""Audio caption, 0-1024 characters after entities parsing"""
|
"""Audio caption, 0-1024 characters after entities parsing"""
|
||||||
parse_mode: Optional[str] = UNSET
|
parse_mode: Optional[str] = UNSET
|
||||||
|
|
@ -45,7 +45,7 @@ class SendAudio(TelegramMethod[Message]):
|
||||||
title: Optional[str] = None
|
title: Optional[str] = None
|
||||||
"""Track name"""
|
"""Track name"""
|
||||||
thumb: Optional[Union[InputFile, str]] = None
|
thumb: Optional[Union[InputFile, str]] = None
|
||||||
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More info on Sending Files » <sending-files>`"""
|
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
|
||||||
disable_notification: Optional[bool] = None
|
disable_notification: Optional[bool] = None
|
||||||
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
||||||
protect_content: Optional[bool] = None
|
protect_content: Optional[bool] = None
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,9 @@ class SendDocument(TelegramMethod[Message]):
|
||||||
chat_id: Union[int, str]
|
chat_id: Union[int, str]
|
||||||
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
||||||
document: Union[InputFile, str]
|
document: Union[InputFile, str]
|
||||||
"""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 info on Sending Files » <sending-files>`"""
|
"""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>`"""
|
||||||
thumb: Optional[Union[InputFile, str]] = None
|
thumb: Optional[Union[InputFile, str]] = None
|
||||||
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More info on Sending Files » <sending-files>`"""
|
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
|
||||||
caption: Optional[str] = None
|
caption: Optional[str] = None
|
||||||
"""Document caption (may also be used when resending documents by *file_id*), 0-1024 characters after entities parsing"""
|
"""Document caption (may also be used when resending documents by *file_id*), 0-1024 characters after entities parsing"""
|
||||||
parse_mode: Optional[str] = UNSET
|
parse_mode: Optional[str] = UNSET
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ class SendGame(TelegramMethod[Message]):
|
||||||
chat_id: int
|
chat_id: int
|
||||||
"""Unique identifier for the target chat"""
|
"""Unique identifier for the target chat"""
|
||||||
game_short_name: str
|
game_short_name: str
|
||||||
"""Short name of the game, serves as the unique identifier for the game. Set up your games via `Botfather <https://t.me/botfather>`_."""
|
"""Short name of the game, serves as the unique identifier for the game. Set up your games via `@BotFather <https://t.me/botfather>`_."""
|
||||||
disable_notification: Optional[bool] = None
|
disable_notification: Optional[bool] = None
|
||||||
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
||||||
protect_content: Optional[bool] = None
|
protect_content: Optional[bool] = None
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ class SendInvoice(TelegramMethod[Message]):
|
||||||
payload: str
|
payload: str
|
||||||
"""Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes."""
|
"""Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes."""
|
||||||
provider_token: str
|
provider_token: str
|
||||||
"""Payments provider token, obtained via `Botfather <https://t.me/botfather>`_"""
|
"""Payment provider token, obtained via `@BotFather <https://t.me/botfather>`_"""
|
||||||
currency: str
|
currency: str
|
||||||
"""Three-letter ISO 4217 currency code, see `more on currencies <https://core.telegram.org/bots/payments#supported-currencies>`_"""
|
"""Three-letter ISO 4217 currency code, see `more on currencies <https://core.telegram.org/bots/payments#supported-currencies>`_"""
|
||||||
prices: List[LabeledPrice]
|
prices: List[LabeledPrice]
|
||||||
|
|
@ -39,11 +39,11 @@ class SendInvoice(TelegramMethod[Message]):
|
||||||
start_parameter: Optional[str] = None
|
start_parameter: Optional[str] = None
|
||||||
"""Unique deep-linking parameter. If left empty, **forwarded copies** of the sent message will have a *Pay* button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a *URL* button with a deep link to the bot (instead of a *Pay* button), with the value used as the start parameter"""
|
"""Unique deep-linking parameter. If left empty, **forwarded copies** of the sent message will have a *Pay* button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a *URL* button with a deep link to the bot (instead of a *Pay* button), with the value used as the start parameter"""
|
||||||
provider_data: Optional[str] = None
|
provider_data: Optional[str] = None
|
||||||
"""A JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider."""
|
"""JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider."""
|
||||||
photo_url: Optional[str] = None
|
photo_url: Optional[str] = None
|
||||||
"""URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for."""
|
"""URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for."""
|
||||||
photo_size: Optional[int] = None
|
photo_size: Optional[int] = None
|
||||||
"""Photo size"""
|
"""Photo size in bytes"""
|
||||||
photo_width: Optional[int] = None
|
photo_width: Optional[int] = None
|
||||||
"""Photo width"""
|
"""Photo width"""
|
||||||
photo_height: Optional[int] = None
|
photo_height: Optional[int] = None
|
||||||
|
|
@ -57,9 +57,9 @@ class SendInvoice(TelegramMethod[Message]):
|
||||||
need_shipping_address: Optional[bool] = None
|
need_shipping_address: Optional[bool] = None
|
||||||
"""Pass :code:`True`, if you require the user's shipping address to complete the order"""
|
"""Pass :code:`True`, if you require the user's shipping address to complete the order"""
|
||||||
send_phone_number_to_provider: Optional[bool] = None
|
send_phone_number_to_provider: Optional[bool] = None
|
||||||
"""Pass :code:`True`, if user's phone number should be sent to provider"""
|
"""Pass :code:`True`, if the user's phone number should be sent to provider"""
|
||||||
send_email_to_provider: Optional[bool] = None
|
send_email_to_provider: Optional[bool] = None
|
||||||
"""Pass :code:`True`, if user's email address should be sent to provider"""
|
"""Pass :code:`True`, if the user's email address should be sent to provider"""
|
||||||
is_flexible: Optional[bool] = None
|
is_flexible: Optional[bool] = None
|
||||||
"""Pass :code:`True`, if the final price depends on the shipping method"""
|
"""Pass :code:`True`, if the final price depends on the shipping method"""
|
||||||
disable_notification: Optional[bool] = None
|
disable_notification: Optional[bool] = None
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ class SendPhoto(TelegramMethod[Message]):
|
||||||
chat_id: Union[int, str]
|
chat_id: Union[int, str]
|
||||||
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
||||||
photo: Union[InputFile, str]
|
photo: Union[InputFile, str]
|
||||||
"""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 info on Sending Files » <sending-files>`"""
|
"""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>`"""
|
||||||
caption: Optional[str] = None
|
caption: Optional[str] = None
|
||||||
"""Photo caption (may also be used when resending photos by *file_id*), 0-1024 characters after entities parsing"""
|
"""Photo caption (may also be used when resending photos by *file_id*), 0-1024 characters after entities parsing"""
|
||||||
parse_mode: Optional[str] = UNSET
|
parse_mode: Optional[str] = UNSET
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ class SendSticker(TelegramMethod[Message]):
|
||||||
chat_id: Union[int, str]
|
chat_id: Union[int, str]
|
||||||
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
||||||
sticker: Union[InputFile, str]
|
sticker: Union[InputFile, str]
|
||||||
"""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 info on Sending Files » <sending-files>`"""
|
"""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>`"""
|
||||||
disable_notification: Optional[bool] = None
|
disable_notification: Optional[bool] = None
|
||||||
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
||||||
protect_content: Optional[bool] = None
|
protect_content: Optional[bool] = None
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ if TYPE_CHECKING:
|
||||||
|
|
||||||
class SendVideo(TelegramMethod[Message]):
|
class SendVideo(TelegramMethod[Message]):
|
||||||
"""
|
"""
|
||||||
Use this method to send video files, Telegram clients support mp4 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.
|
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
|
Source: https://core.telegram.org/bots/api#sendvideo
|
||||||
"""
|
"""
|
||||||
|
|
@ -30,7 +30,7 @@ class SendVideo(TelegramMethod[Message]):
|
||||||
chat_id: Union[int, str]
|
chat_id: Union[int, str]
|
||||||
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
||||||
video: Union[InputFile, str]
|
video: Union[InputFile, str]
|
||||||
"""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 info on Sending Files » <sending-files>`"""
|
"""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>`"""
|
||||||
duration: Optional[int] = None
|
duration: Optional[int] = None
|
||||||
"""Duration of sent video in seconds"""
|
"""Duration of sent video in seconds"""
|
||||||
width: Optional[int] = None
|
width: Optional[int] = None
|
||||||
|
|
@ -38,7 +38,7 @@ class SendVideo(TelegramMethod[Message]):
|
||||||
height: Optional[int] = None
|
height: Optional[int] = None
|
||||||
"""Video height"""
|
"""Video height"""
|
||||||
thumb: Optional[Union[InputFile, str]] = None
|
thumb: Optional[Union[InputFile, str]] = None
|
||||||
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More info on Sending Files » <sending-files>`"""
|
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
|
||||||
caption: Optional[str] = None
|
caption: Optional[str] = None
|
||||||
"""Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing"""
|
"""Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing"""
|
||||||
parse_mode: Optional[str] = UNSET
|
parse_mode: Optional[str] = UNSET
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ if TYPE_CHECKING:
|
||||||
|
|
||||||
class SendVideoNote(TelegramMethod[Message]):
|
class SendVideoNote(TelegramMethod[Message]):
|
||||||
"""
|
"""
|
||||||
As of `v.4.0 <https://telegram.org/blog/video-messages-and-telescope>`_, Telegram clients support rounded square mp4 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.
|
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
|
Source: https://core.telegram.org/bots/api#sendvideonote
|
||||||
"""
|
"""
|
||||||
|
|
@ -28,13 +28,13 @@ class SendVideoNote(TelegramMethod[Message]):
|
||||||
chat_id: Union[int, str]
|
chat_id: Union[int, str]
|
||||||
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
||||||
video_note: Union[InputFile, str]
|
video_note: Union[InputFile, str]
|
||||||
"""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 info on Sending Files » <sending-files>`. Sending video notes by a URL is currently unsupported"""
|
"""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"""
|
||||||
duration: Optional[int] = None
|
duration: Optional[int] = None
|
||||||
"""Duration of sent video in seconds"""
|
"""Duration of sent video in seconds"""
|
||||||
length: Optional[int] = None
|
length: Optional[int] = None
|
||||||
"""Video width and height, i.e. diameter of the video message"""
|
"""Video width and height, i.e. diameter of the video message"""
|
||||||
thumb: Optional[Union[InputFile, str]] = None
|
thumb: Optional[Union[InputFile, str]] = None
|
||||||
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More info on Sending Files » <sending-files>`"""
|
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
|
||||||
disable_notification: Optional[bool] = None
|
disable_notification: Optional[bool] = None
|
||||||
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
||||||
protect_content: Optional[bool] = None
|
protect_content: Optional[bool] = None
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ class SendVoice(TelegramMethod[Message]):
|
||||||
chat_id: Union[int, str]
|
chat_id: Union[int, str]
|
||||||
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
||||||
voice: Union[InputFile, str]
|
voice: Union[InputFile, str]
|
||||||
"""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 info on Sending Files » <sending-files>`"""
|
"""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>`"""
|
||||||
caption: Optional[str] = None
|
caption: Optional[str] = None
|
||||||
"""Voice message caption, 0-1024 characters after entities parsing"""
|
"""Voice message caption, 0-1024 characters after entities parsing"""
|
||||||
parse_mode: Optional[str] = UNSET
|
parse_mode: Optional[str] = UNSET
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ class SetChatMenuButton(TelegramMethod[bool]):
|
||||||
chat_id: Optional[int] = None
|
chat_id: Optional[int] = None
|
||||||
"""Unique identifier for the target private chat. If not specified, default bot's menu button will be changed"""
|
"""Unique identifier for the target private chat. If not specified, default bot's menu button will be changed"""
|
||||||
menu_button: Optional[MenuButton] = None
|
menu_button: Optional[MenuButton] = None
|
||||||
"""A JSON-serialized object for the new bot's menu button. Defaults to :class:`aiogram.types.menu_button_default.MenuButtonDefault`"""
|
"""A JSON-serialized object for the bot's new menu button. Defaults to :class:`aiogram.types.menu_button_default.MenuButtonDefault`"""
|
||||||
|
|
||||||
def build_request(self, bot: Bot) -> Request:
|
def build_request(self, bot: Bot) -> Request:
|
||||||
data: Dict[str, Any] = self.dict()
|
data: Dict[str, Any] = self.dict()
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ class SetStickerSetThumb(TelegramMethod[bool]):
|
||||||
user_id: int
|
user_id: int
|
||||||
"""User identifier of the sticker set owner"""
|
"""User identifier of the sticker set owner"""
|
||||||
thumb: Optional[Union[InputFile, str]] = None
|
thumb: Optional[Union[InputFile, str]] = None
|
||||||
"""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 info on Sending Files » <sending-files>`. Animated sticker set thumbnails can't be uploaded via HTTP URL."""
|
"""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."""
|
||||||
|
|
||||||
def build_request(self, bot: Bot) -> Request:
|
def build_request(self, bot: Bot) -> Request:
|
||||||
data: Dict[str, Any] = self.dict(exclude={"thumb"})
|
data: Dict[str, Any] = self.dict(exclude={"thumb"})
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@ if TYPE_CHECKING:
|
||||||
|
|
||||||
class SetWebhook(TelegramMethod[bool]):
|
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, we will give up after a reasonable amount of attempts. Returns :code:`True` on success.
|
||||||
If you'd like to make sure that the Webhook request comes from Telegram, we recommend using a secret path in the URL, e.g. :code:`https://www.example.com/<token>`. Since nobody else knows your bot's token, you can be pretty sure it's us.
|
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**
|
**Notes**
|
||||||
|
|
||||||
|
|
@ -20,8 +20,8 @@ class SetWebhook(TelegramMethod[bool]):
|
||||||
|
|
||||||
**2.** To use a self-signed certificate, you need to upload your `public key certificate <https://core.telegram.org/bots/self-signed>`_ using *certificate* parameter. Please upload as InputFile, sending a String will not work.
|
**2.** To use a self-signed certificate, you need to upload your `public key certificate <https://core.telegram.org/bots/self-signed>`_ using *certificate* parameter. Please upload as InputFile, sending a String will not work.
|
||||||
|
|
||||||
**3.** Ports currently supported *for Webhooks*: **443, 80, 88, 8443**.
|
**3.** Ports currently supported *for webhooks*: **443, 80, 88, 8443**.
|
||||||
**NEW!** If you're having any trouble setting up webhooks, please check out this `amazing guide to Webhooks <https://core.telegram.org/bots/webhooks>`_.
|
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
|
Source: https://core.telegram.org/bots/api#setwebhook
|
||||||
"""
|
"""
|
||||||
|
|
@ -29,17 +29,19 @@ class SetWebhook(TelegramMethod[bool]):
|
||||||
__returning__ = bool
|
__returning__ = bool
|
||||||
|
|
||||||
url: str
|
url: str
|
||||||
"""HTTPS url to send updates to. Use an empty string to remove webhook integration"""
|
"""HTTPS URL to send updates to. Use an empty string to remove webhook integration"""
|
||||||
certificate: Optional[InputFile] = None
|
certificate: Optional[InputFile] = None
|
||||||
"""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."""
|
"""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."""
|
||||||
ip_address: Optional[str] = None
|
ip_address: Optional[str] = None
|
||||||
"""The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS"""
|
"""The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS"""
|
||||||
max_connections: Optional[int] = None
|
max_connections: Optional[int] = None
|
||||||
"""Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to *40*. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput."""
|
"""The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to *40*. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput."""
|
||||||
allowed_updates: Optional[List[str]] = None
|
allowed_updates: Optional[List[str]] = None
|
||||||
"""A JSON-serialized list of the update types you want your bot to receive. For example, specify ['message', 'edited_channel_post', 'callback_query'] to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member* (default). If not specified, the previous setting will be used."""
|
"""A JSON-serialized list of the update types you want your bot to receive. For example, specify ['message', 'edited_channel_post', 'callback_query'] to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member* (default). If not specified, the previous setting will be used."""
|
||||||
drop_pending_updates: Optional[bool] = None
|
drop_pending_updates: Optional[bool] = None
|
||||||
"""Pass :code:`True` to drop all pending updates"""
|
"""Pass :code:`True` to drop all pending updates"""
|
||||||
|
secret_token: Optional[str] = None
|
||||||
|
"""A secret token to be sent in a header 'X-Telegram-Bot-Api-Secret-Token' in every webhook request, 1-256 characters. Only characters :code:`A-Z`, :code:`a-z`, :code:`0-9`, :code:`_` and :code:`-` are allowed. The header is useful to ensure that the request comes from a webhook set by you."""
|
||||||
|
|
||||||
def build_request(self, bot: Bot) -> Request:
|
def build_request(self, bot: Bot) -> Request:
|
||||||
data: Dict[str, Any] = self.dict(exclude={"certificate"})
|
data: Dict[str, Any] = self.dict(exclude={"certificate"})
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ class UploadStickerFile(TelegramMethod[File]):
|
||||||
user_id: int
|
user_id: int
|
||||||
"""User identifier of sticker file owner"""
|
"""User identifier of sticker file owner"""
|
||||||
png_sticker: InputFile
|
png_sticker: InputFile
|
||||||
"""**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 info on Sending Files » <sending-files>`"""
|
"""**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>`"""
|
||||||
|
|
||||||
def build_request(self, bot: Bot) -> Request:
|
def build_request(self, bot: Bot) -> Request:
|
||||||
data: Dict[str, Any] = self.dict(exclude={"png_sticker"})
|
data: Dict[str, Any] = self.dict(exclude={"png_sticker"})
|
||||||
|
|
|
||||||
|
|
@ -32,4 +32,4 @@ class Animation(TelegramObject):
|
||||||
mime_type: Optional[str] = None
|
mime_type: Optional[str] = None
|
||||||
"""*Optional*. MIME type of the file as defined by sender"""
|
"""*Optional*. MIME type of the file as defined by sender"""
|
||||||
file_size: Optional[int] = None
|
file_size: Optional[int] = None
|
||||||
"""*Optional*. File size in bytes"""
|
"""*Optional*. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."""
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,6 @@ class Audio(TelegramObject):
|
||||||
mime_type: Optional[str] = None
|
mime_type: Optional[str] = None
|
||||||
"""*Optional*. MIME type of the file as defined by sender"""
|
"""*Optional*. MIME type of the file as defined by sender"""
|
||||||
file_size: Optional[int] = None
|
file_size: Optional[int] = None
|
||||||
"""*Optional*. File size in bytes"""
|
"""*Optional*. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."""
|
||||||
thumb: Optional[PhotoSize] = None
|
thumb: Optional[PhotoSize] = None
|
||||||
"""*Optional*. Thumbnail of the album cover to which the music file belongs"""
|
"""*Optional*. Thumbnail of the album cover to which the music file belongs"""
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ class CallbackQuery(TelegramObject):
|
||||||
inline_message_id: Optional[str] = None
|
inline_message_id: Optional[str] = None
|
||||||
"""*Optional*. Identifier of the message sent via the bot in inline mode, that originated the query."""
|
"""*Optional*. Identifier of the message sent via the bot in inline mode, that originated the query."""
|
||||||
data: Optional[str] = None
|
data: Optional[str] = None
|
||||||
"""*Optional*. Data associated with the callback button. Be aware that a bad client can send arbitrary data in this field."""
|
"""*Optional*. Data associated with the callback button. Be aware that the message originated the query can contain no callback buttons with this data."""
|
||||||
game_short_name: Optional[str] = None
|
game_short_name: Optional[str] = None
|
||||||
"""*Optional*. Short name of a `Game <https://core.telegram.org/bots/api#games>`_ to be returned, serves as the unique identifier for the game"""
|
"""*Optional*. Short name of a `Game <https://core.telegram.org/bots/api#games>`_ to be returned, serves as the unique identifier for the game"""
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,11 @@ class Chat(TelegramObject):
|
||||||
bio: Optional[str] = None
|
bio: Optional[str] = None
|
||||||
"""*Optional*. Bio of the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
|
"""*Optional*. Bio of the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
|
||||||
has_private_forwards: Optional[bool] = None
|
has_private_forwards: Optional[bool] = None
|
||||||
"""*Optional*. True, if privacy settings of the other party in the private chat allows to use :code:`tg://user?id=<user_id>` links only in chats with the user. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
|
"""*Optional*. :code:`True`, if privacy settings of the other party in the private chat allows to use :code:`tg://user?id=<user_id>` links only in chats with the user. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
|
||||||
|
join_to_send_messages: Optional[bool] = None
|
||||||
|
"""*Optional*. :code:`True`, if users need to join the supergroup before they can send messages. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
|
||||||
|
join_by_request: Optional[bool] = None
|
||||||
|
"""*Optional*. :code:`True`, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
|
||||||
description: Optional[str] = None
|
description: Optional[str] = None
|
||||||
"""*Optional*. Description, for groups, supergroups and channel chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
|
"""*Optional*. Description, for groups, supergroups and channel chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
|
||||||
invite_link: Optional[str] = None
|
invite_link: Optional[str] = None
|
||||||
|
|
@ -50,7 +54,7 @@ class Chat(TelegramObject):
|
||||||
message_auto_delete_time: Optional[int] = None
|
message_auto_delete_time: Optional[int] = None
|
||||||
"""*Optional*. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
|
"""*Optional*. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
|
||||||
has_protected_content: Optional[bool] = None
|
has_protected_content: Optional[bool] = None
|
||||||
"""*Optional*. True, if messages from the chat can't be forwarded to other chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
|
"""*Optional*. :code:`True`, if messages from the chat can't be forwarded to other chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
|
||||||
sticker_set_name: Optional[str] = None
|
sticker_set_name: Optional[str] = None
|
||||||
"""*Optional*. For supergroups, name of group sticker set. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
|
"""*Optional*. For supergroups, name of group sticker set. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
|
||||||
can_set_sticker_set: Optional[bool] = None
|
can_set_sticker_set: Optional[bool] = None
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,6 @@ class ChatInviteLink(TelegramObject):
|
||||||
expire_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None
|
expire_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None
|
||||||
"""*Optional*. Point in time (Unix timestamp) when the link will expire or has been expired"""
|
"""*Optional*. Point in time (Unix timestamp) when the link will expire or has been expired"""
|
||||||
member_limit: Optional[int] = None
|
member_limit: Optional[int] = None
|
||||||
"""*Optional*. Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999"""
|
"""*Optional*. The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999"""
|
||||||
pending_join_request_count: Optional[int] = None
|
pending_join_request_count: Optional[int] = None
|
||||||
"""*Optional*. Number of pending join requests created using this link"""
|
"""*Optional*. Number of pending join requests created using this link"""
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ if TYPE_CHECKING:
|
||||||
class ChosenInlineResult(TelegramObject):
|
class ChosenInlineResult(TelegramObject):
|
||||||
"""
|
"""
|
||||||
Represents a `result <https://core.telegram.org/bots/api#inlinequeryresult>`_ of an inline query that was chosen by the user and sent to their chat partner.
|
Represents a `result <https://core.telegram.org/bots/api#inlinequeryresult>`_ of an inline query that was chosen by the user and sent to their chat partner.
|
||||||
**Note:** It is necessary to enable `inline feedback <https://core.telegram.org/bots/inline#collecting-feedback>`_ via `@Botfather <https://t.me/botfather>`_ in order to receive these objects in updates.
|
**Note:** It is necessary to enable `inline feedback <https://core.telegram.org/bots/inline#collecting-feedback>`_ via `@BotFather <https://t.me/botfather>`_ in order to receive these objects in updates.
|
||||||
|
|
||||||
Source: https://core.telegram.org/bots/api#choseninlineresult
|
Source: https://core.telegram.org/bots/api#choseninlineresult
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -26,4 +26,4 @@ class Document(TelegramObject):
|
||||||
mime_type: Optional[str] = None
|
mime_type: Optional[str] = None
|
||||||
"""*Optional*. MIME type of the file as defined by sender"""
|
"""*Optional*. MIME type of the file as defined by sender"""
|
||||||
file_size: Optional[int] = None
|
file_size: Optional[int] = None
|
||||||
"""*Optional*. File size in bytes"""
|
"""*Optional*. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."""
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ from .base import TelegramObject
|
||||||
|
|
||||||
class EncryptedCredentials(TelegramObject):
|
class EncryptedCredentials(TelegramObject):
|
||||||
"""
|
"""
|
||||||
Contains data required for decrypting and authenticating :class:`aiogram.types.encrypted_passport_element.EncryptedPassportElement`. See the `Telegram Passport Documentation <https://core.telegram.org/passport#receiving-information>`_ for a complete description of the data decryption and authentication processes.
|
Describes data required for decrypting and authenticating :class:`aiogram.types.encrypted_passport_element.EncryptedPassportElement`. See the `Telegram Passport Documentation <https://core.telegram.org/passport#receiving-information>`_ for a complete description of the data decryption and authentication processes.
|
||||||
|
|
||||||
Source: https://core.telegram.org/bots/api#encryptedcredentials
|
Source: https://core.telegram.org/bots/api#encryptedcredentials
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ if TYPE_CHECKING:
|
||||||
|
|
||||||
class EncryptedPassportElement(TelegramObject):
|
class EncryptedPassportElement(TelegramObject):
|
||||||
"""
|
"""
|
||||||
Contains information about documents or other Telegram Passport elements shared with the bot by the user.
|
Describes documents or other Telegram Passport elements shared with the bot by the user.
|
||||||
|
|
||||||
Source: https://core.telegram.org/bots/api#encryptedpassportelement
|
Source: https://core.telegram.org/bots/api#encryptedpassportelement
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ class File(TelegramObject):
|
||||||
"""
|
"""
|
||||||
This object represents a file ready to be downloaded. The file can be downloaded via the link :code:`https://api.telegram.org/file/bot<token>/<file_path>`. 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`.
|
This object represents a file ready to be downloaded. The file can be downloaded via the link :code:`https://api.telegram.org/file/bot<token>/<file_path>`. 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`.
|
||||||
|
|
||||||
Maximum file size to download is 20 MB
|
The maximum file size to download is 20 MB
|
||||||
|
|
||||||
Source: https://core.telegram.org/bots/api#file
|
Source: https://core.telegram.org/bots/api#file
|
||||||
"""
|
"""
|
||||||
|
|
@ -19,6 +19,6 @@ class File(TelegramObject):
|
||||||
file_unique_id: str
|
file_unique_id: str
|
||||||
"""Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."""
|
"""Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."""
|
||||||
file_size: Optional[int] = None
|
file_size: Optional[int] = None
|
||||||
"""*Optional*. File size in bytes, if known"""
|
"""*Optional*. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."""
|
||||||
file_path: Optional[str] = None
|
file_path: Optional[str] = None
|
||||||
"""*Optional*. File path. Use :code:`https://api.telegram.org/file/bot<token>/<file_path>` to get the file."""
|
"""*Optional*. File path. Use :code:`https://api.telegram.org/file/bot<token>/<file_path>` to get the file."""
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ class ForceReply(MutableTelegramObject):
|
||||||
- Explain the user how to send a command with parameters (e.g. /newpoll question answer1 answer2). May be appealing for hardcore users but lacks modern day polish.
|
- Explain the user how to send a command with parameters (e.g. /newpoll question answer1 answer2). May be appealing for hardcore users but lacks modern day polish.
|
||||||
- Guide the user through a step-by-step process. 'Please send me your question', 'Cool, now let's add the first answer option', 'Great. Keep adding answer options, then send /done when you're ready'.
|
- Guide the user through a step-by-step process. 'Please send me your question', 'Cool, now let's add the first answer option', 'Great. Keep adding answer options, then send /done when you're ready'.
|
||||||
|
|
||||||
The last option is definitely more attractive. And if you use :class:`aiogram.types.force_reply.ForceReply` in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions — without any extra work for the user.
|
The last option is definitely more attractive. And if you use :class:`aiogram.types.force_reply.ForceReply` in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions - without any extra work for the user.
|
||||||
|
|
||||||
Source: https://core.telegram.org/bots/api#forcereply
|
Source: https://core.telegram.org/bots/api#forcereply
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -20,17 +20,17 @@ class InlineKeyboardButton(MutableTelegramObject):
|
||||||
text: str
|
text: str
|
||||||
"""Label text on the button"""
|
"""Label text on the button"""
|
||||||
url: Optional[str] = None
|
url: Optional[str] = None
|
||||||
"""*Optional*. HTTP or tg:// url to be opened when the button is pressed. Links :code:`tg://user?id=<user_id>` can be used to mention a user by their ID without using a username, if this is allowed by their privacy settings."""
|
"""*Optional*. HTTP or tg:// URL to be opened when the button is pressed. Links :code:`tg://user?id=<user_id>` can be used to mention a user by their ID without using a username, if this is allowed by their privacy settings."""
|
||||||
callback_data: Optional[str] = None
|
callback_data: Optional[str] = None
|
||||||
"""*Optional*. Data to be sent in a `callback query <https://core.telegram.org/bots/api#callbackquery>`_ to the bot when button is pressed, 1-64 bytes"""
|
"""*Optional*. Data to be sent in a `callback query <https://core.telegram.org/bots/api#callbackquery>`_ to the bot when button is pressed, 1-64 bytes"""
|
||||||
web_app: Optional[WebAppInfo] = None
|
web_app: Optional[WebAppInfo] = None
|
||||||
"""*Optional*. Description of the `Web App <https://core.telegram.org/bots/webapps>`_ that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method :class:`aiogram.methods.answer_web_app_query.AnswerWebAppQuery`. Available only in private chats between a user and the bot."""
|
"""*Optional*. Description of the `Web App <https://core.telegram.org/bots/webapps>`_ that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method :class:`aiogram.methods.answer_web_app_query.AnswerWebAppQuery`. Available only in private chats between a user and the bot."""
|
||||||
login_url: Optional[LoginUrl] = None
|
login_url: Optional[LoginUrl] = None
|
||||||
"""*Optional*. An HTTP URL used to automatically authorize the user. Can be used as a replacement for the `Telegram Login Widget <https://core.telegram.org/widgets/login>`_."""
|
"""*Optional*. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the `Telegram Login Widget <https://core.telegram.org/widgets/login>`_."""
|
||||||
switch_inline_query: Optional[str] = None
|
switch_inline_query: Optional[str] = None
|
||||||
"""*Optional*. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. Can be empty, in which case just the bot's username will be inserted."""
|
"""*Optional*. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted."""
|
||||||
switch_inline_query_current_chat: Optional[str] = None
|
switch_inline_query_current_chat: Optional[str] = None
|
||||||
"""*Optional*. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. Can be empty, in which case only the bot's username will be inserted."""
|
"""*Optional*. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted."""
|
||||||
callback_game: Optional[CallbackGame] = None
|
callback_game: Optional[CallbackGame] = None
|
||||||
"""*Optional*. Description of the game that will be launched when the user presses the button."""
|
"""*Optional*. Description of the game that will be launched when the user presses the button."""
|
||||||
pay: Optional[bool] = None
|
pay: Optional[bool] = None
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ class InlineQuery(TelegramObject):
|
||||||
offset: str
|
offset: str
|
||||||
"""Offset of the results to be returned, can be controlled by the bot"""
|
"""Offset of the results to be returned, can be controlled by the bot"""
|
||||||
chat_type: Optional[str] = None
|
chat_type: Optional[str] = None
|
||||||
"""*Optional*. Type of the chat, from which the inline query was sent. Can be either 'sender' for a private chat with the inline query sender, 'private', 'group', 'supergroup', or 'channel'. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat"""
|
"""*Optional*. Type of the chat from which the inline query was sent. Can be either 'sender' for a private chat with the inline query sender, 'private', 'group', 'supergroup', or 'channel'. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat"""
|
||||||
location: Optional[Location] = None
|
location: Optional[Location] = None
|
||||||
"""*Optional*. Sender location, only for bots that request user location"""
|
"""*Optional*. Sender location, only for bots that request user location"""
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ class InlineQueryResultCachedMpeg4Gif(InlineQueryResult):
|
||||||
id: str
|
id: str
|
||||||
"""Unique identifier for this result, 1-64 bytes"""
|
"""Unique identifier for this result, 1-64 bytes"""
|
||||||
mpeg4_file_id: str
|
mpeg4_file_id: str
|
||||||
"""A valid file identifier for the MP4 file"""
|
"""A valid file identifier for the MPEG4 file"""
|
||||||
title: Optional[str] = None
|
title: Optional[str] = None
|
||||||
"""*Optional*. Title for the result"""
|
"""*Optional*. Title for the result"""
|
||||||
caption: Optional[str] = None
|
caption: Optional[str] = None
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ class InlineQueryResultDocument(InlineQueryResult):
|
||||||
document_url: str
|
document_url: str
|
||||||
"""A valid URL for the file"""
|
"""A valid URL for the file"""
|
||||||
mime_type: str
|
mime_type: str
|
||||||
"""Mime type of the content of the file, either 'application/pdf' or 'application/zip'"""
|
"""MIME type of the content of the file, either 'application/pdf' or 'application/zip'"""
|
||||||
caption: Optional[str] = None
|
caption: Optional[str] = None
|
||||||
"""*Optional*. Caption of the document to be sent, 0-1024 characters after entities parsing"""
|
"""*Optional*. Caption of the document to be sent, 0-1024 characters after entities parsing"""
|
||||||
parse_mode: Optional[str] = UNSET
|
parse_mode: Optional[str] = UNSET
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult):
|
||||||
id: str
|
id: str
|
||||||
"""Unique identifier for this result, 1-64 bytes"""
|
"""Unique identifier for this result, 1-64 bytes"""
|
||||||
mpeg4_url: str
|
mpeg4_url: str
|
||||||
"""A valid URL for the MP4 file. File size must not exceed 1MB"""
|
"""A valid URL for the MPEG4 file. File size must not exceed 1MB"""
|
||||||
thumb_url: str
|
thumb_url: str
|
||||||
"""URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result"""
|
"""URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result"""
|
||||||
mpeg4_width: Optional[int] = None
|
mpeg4_width: Optional[int] = None
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ class InlineQueryResultVideo(InlineQueryResult):
|
||||||
video_url: str
|
video_url: str
|
||||||
"""A valid URL for the embedded video player or video file"""
|
"""A valid URL for the embedded video player or video file"""
|
||||||
mime_type: str
|
mime_type: str
|
||||||
"""Mime type of the content of video url, 'text/html' or 'video/mp4'"""
|
"""MIME type of the content of the video URL, 'text/html' or 'video/mp4'"""
|
||||||
thumb_url: str
|
thumb_url: str
|
||||||
"""URL of the thumbnail (JPEG only) for the video"""
|
"""URL of the thumbnail (JPEG only) for the video"""
|
||||||
title: str
|
title: str
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ class InputInvoiceMessageContent(InputMessageContent):
|
||||||
payload: str
|
payload: str
|
||||||
"""Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes."""
|
"""Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes."""
|
||||||
provider_token: str
|
provider_token: str
|
||||||
"""Payment provider token, obtained via `Botfather <https://t.me/botfather>`_"""
|
"""Payment provider token, obtained via `@BotFather <https://t.me/botfather>`_"""
|
||||||
currency: str
|
currency: str
|
||||||
"""Three-letter ISO 4217 currency code, see `more on currencies <https://core.telegram.org/bots/payments#supported-currencies>`_"""
|
"""Three-letter ISO 4217 currency code, see `more on currencies <https://core.telegram.org/bots/payments#supported-currencies>`_"""
|
||||||
prices: List[LabeledPrice]
|
prices: List[LabeledPrice]
|
||||||
|
|
@ -34,9 +34,9 @@ class InputInvoiceMessageContent(InputMessageContent):
|
||||||
provider_data: Optional[str] = None
|
provider_data: Optional[str] = None
|
||||||
"""*Optional*. A JSON-serialized object for data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider."""
|
"""*Optional*. A JSON-serialized object for data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider."""
|
||||||
photo_url: Optional[str] = None
|
photo_url: Optional[str] = None
|
||||||
"""*Optional*. URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for."""
|
"""*Optional*. URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service."""
|
||||||
photo_size: Optional[int] = None
|
photo_size: Optional[int] = None
|
||||||
"""*Optional*. Photo size"""
|
"""*Optional*. Photo size in bytes"""
|
||||||
photo_width: Optional[int] = None
|
photo_width: Optional[int] = None
|
||||||
"""*Optional*. Photo width"""
|
"""*Optional*. Photo width"""
|
||||||
photo_height: Optional[int] = None
|
photo_height: Optional[int] = None
|
||||||
|
|
@ -50,8 +50,8 @@ class InputInvoiceMessageContent(InputMessageContent):
|
||||||
need_shipping_address: Optional[bool] = None
|
need_shipping_address: Optional[bool] = None
|
||||||
"""*Optional*. Pass :code:`True`, if you require the user's shipping address to complete the order"""
|
"""*Optional*. Pass :code:`True`, if you require the user's shipping address to complete the order"""
|
||||||
send_phone_number_to_provider: Optional[bool] = None
|
send_phone_number_to_provider: Optional[bool] = None
|
||||||
"""*Optional*. Pass :code:`True`, if user's phone number should be sent to provider"""
|
"""*Optional*. Pass :code:`True`, if the user's phone number should be sent to provider"""
|
||||||
send_email_to_provider: Optional[bool] = None
|
send_email_to_provider: Optional[bool] = None
|
||||||
"""*Optional*. Pass :code:`True`, if user's email address should be sent to provider"""
|
"""*Optional*. Pass :code:`True`, if the user's email address should be sent to provider"""
|
||||||
is_flexible: Optional[bool] = None
|
is_flexible: Optional[bool] = None
|
||||||
"""*Optional*. Pass :code:`True`, if the final price depends on the shipping method"""
|
"""*Optional*. Pass :code:`True`, if the final price depends on the shipping method"""
|
||||||
|
|
|
||||||
|
|
@ -22,9 +22,9 @@ class InputMediaAnimation(InputMedia):
|
||||||
type: str = Field("animation", const=True)
|
type: str = Field("animation", const=True)
|
||||||
"""Type of the result, must be *animation*"""
|
"""Type of the result, must be *animation*"""
|
||||||
media: Union[str, InputFile]
|
media: Union[str, InputFile]
|
||||||
"""File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://<file_attach_name>' to upload a new one using multipart/form-data under <file_attach_name> name. :ref:`More info on Sending Files » <sending-files>`"""
|
"""File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://<file_attach_name>' to upload a new one using multipart/form-data under <file_attach_name> name. :ref:`More information on Sending Files » <sending-files>`"""
|
||||||
thumb: Optional[Union[InputFile, str]] = None
|
thumb: Optional[Union[InputFile, str]] = None
|
||||||
"""*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More info on Sending Files » <sending-files>`"""
|
"""*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
|
||||||
caption: Optional[str] = None
|
caption: Optional[str] = None
|
||||||
"""*Optional*. Caption of the animation to be sent, 0-1024 characters after entities parsing"""
|
"""*Optional*. Caption of the animation to be sent, 0-1024 characters after entities parsing"""
|
||||||
parse_mode: Optional[str] = UNSET
|
parse_mode: Optional[str] = UNSET
|
||||||
|
|
|
||||||
|
|
@ -22,9 +22,9 @@ class InputMediaAudio(InputMedia):
|
||||||
type: str = Field("audio", const=True)
|
type: str = Field("audio", const=True)
|
||||||
"""Type of the result, must be *audio*"""
|
"""Type of the result, must be *audio*"""
|
||||||
media: Union[str, InputFile]
|
media: Union[str, InputFile]
|
||||||
"""File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://<file_attach_name>' to upload a new one using multipart/form-data under <file_attach_name> name. :ref:`More info on Sending Files » <sending-files>`"""
|
"""File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://<file_attach_name>' to upload a new one using multipart/form-data under <file_attach_name> name. :ref:`More information on Sending Files » <sending-files>`"""
|
||||||
thumb: Optional[Union[InputFile, str]] = None
|
thumb: Optional[Union[InputFile, str]] = None
|
||||||
"""*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More info on Sending Files » <sending-files>`"""
|
"""*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
|
||||||
caption: Optional[str] = None
|
caption: Optional[str] = None
|
||||||
"""*Optional*. Caption of the audio to be sent, 0-1024 characters after entities parsing"""
|
"""*Optional*. Caption of the audio to be sent, 0-1024 characters after entities parsing"""
|
||||||
parse_mode: Optional[str] = UNSET
|
parse_mode: Optional[str] = UNSET
|
||||||
|
|
|
||||||
|
|
@ -22,9 +22,9 @@ class InputMediaDocument(InputMedia):
|
||||||
type: str = Field("document", const=True)
|
type: str = Field("document", const=True)
|
||||||
"""Type of the result, must be *document*"""
|
"""Type of the result, must be *document*"""
|
||||||
media: Union[str, InputFile]
|
media: Union[str, InputFile]
|
||||||
"""File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://<file_attach_name>' to upload a new one using multipart/form-data under <file_attach_name> name. :ref:`More info on Sending Files » <sending-files>`"""
|
"""File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://<file_attach_name>' to upload a new one using multipart/form-data under <file_attach_name> name. :ref:`More information on Sending Files » <sending-files>`"""
|
||||||
thumb: Optional[Union[InputFile, str]] = None
|
thumb: Optional[Union[InputFile, str]] = None
|
||||||
"""*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More info on Sending Files » <sending-files>`"""
|
"""*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
|
||||||
caption: Optional[str] = None
|
caption: Optional[str] = None
|
||||||
"""*Optional*. Caption of the document to be sent, 0-1024 characters after entities parsing"""
|
"""*Optional*. Caption of the document to be sent, 0-1024 characters after entities parsing"""
|
||||||
parse_mode: Optional[str] = UNSET
|
parse_mode: Optional[str] = UNSET
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ class InputMediaPhoto(InputMedia):
|
||||||
type: str = Field("photo", const=True)
|
type: str = Field("photo", const=True)
|
||||||
"""Type of the result, must be *photo*"""
|
"""Type of the result, must be *photo*"""
|
||||||
media: Union[str, InputFile]
|
media: Union[str, InputFile]
|
||||||
"""File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://<file_attach_name>' to upload a new one using multipart/form-data under <file_attach_name> name. :ref:`More info on Sending Files » <sending-files>`"""
|
"""File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://<file_attach_name>' to upload a new one using multipart/form-data under <file_attach_name> name. :ref:`More information on Sending Files » <sending-files>`"""
|
||||||
caption: Optional[str] = None
|
caption: Optional[str] = None
|
||||||
"""*Optional*. Caption of the photo to be sent, 0-1024 characters after entities parsing"""
|
"""*Optional*. Caption of the photo to be sent, 0-1024 characters after entities parsing"""
|
||||||
parse_mode: Optional[str] = UNSET
|
parse_mode: Optional[str] = UNSET
|
||||||
|
|
|
||||||
|
|
@ -22,9 +22,9 @@ class InputMediaVideo(InputMedia):
|
||||||
type: str = Field("video", const=True)
|
type: str = Field("video", const=True)
|
||||||
"""Type of the result, must be *video*"""
|
"""Type of the result, must be *video*"""
|
||||||
media: Union[str, InputFile]
|
media: Union[str, InputFile]
|
||||||
"""File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://<file_attach_name>' to upload a new one using multipart/form-data under <file_attach_name> name. :ref:`More info on Sending Files » <sending-files>`"""
|
"""File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://<file_attach_name>' to upload a new one using multipart/form-data under <file_attach_name> name. :ref:`More information on Sending Files » <sending-files>`"""
|
||||||
thumb: Optional[Union[InputFile, str]] = None
|
thumb: Optional[Union[InputFile, str]] = None
|
||||||
"""*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More info on Sending Files » <sending-files>`"""
|
"""*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
|
||||||
caption: Optional[str] = None
|
caption: Optional[str] = None
|
||||||
"""*Optional*. Caption of the video to be sent, 0-1024 characters after entities parsing"""
|
"""*Optional*. Caption of the video to be sent, 0-1024 characters after entities parsing"""
|
||||||
parse_mode: Optional[str] = UNSET
|
parse_mode: Optional[str] = UNSET
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ class WebApp(MutableTelegramObject):
|
||||||
|
|
||||||
class KeyboardButton(MutableTelegramObject):
|
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 *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 text of the button. Optional fields *web_app*, *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_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:** *request_poll* option will only work in Telegram versions released after 23 January, 2020. Older clients will display *unsupported message*.
|
||||||
|
|
|
||||||
|
|
@ -23,4 +23,4 @@ class Location(TelegramObject):
|
||||||
heading: Optional[int] = None
|
heading: Optional[int] = None
|
||||||
"""*Optional*. The direction in which user is moving, in degrees; 1-360. For active live locations only."""
|
"""*Optional*. The direction in which user is moving, in degrees; 1-360. For active live locations only."""
|
||||||
proximity_alert_radius: Optional[int] = None
|
proximity_alert_radius: Optional[int] = None
|
||||||
"""*Optional*. Maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only."""
|
"""*Optional*. The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only."""
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ class Message(TelegramObject):
|
||||||
from_user: Optional[User] = Field(None, alias="from")
|
from_user: Optional[User] = Field(None, alias="from")
|
||||||
"""*Optional*. Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat."""
|
"""*Optional*. Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat."""
|
||||||
sender_chat: Optional[Chat] = None
|
sender_chat: Optional[Chat] = None
|
||||||
"""*Optional*. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field *from* contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat."""
|
"""*Optional*. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field *from* contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat."""
|
||||||
forward_from: Optional[User] = None
|
forward_from: Optional[User] = None
|
||||||
"""*Optional*. For forwarded messages, sender of the original message"""
|
"""*Optional*. For forwarded messages, sender of the original message"""
|
||||||
forward_from_chat: Optional[Chat] = None
|
forward_from_chat: Optional[Chat] = None
|
||||||
|
|
@ -102,7 +102,7 @@ class Message(TelegramObject):
|
||||||
forward_date: Optional[int] = None
|
forward_date: Optional[int] = None
|
||||||
"""*Optional*. For forwarded messages, date the original message was sent in Unix time"""
|
"""*Optional*. For forwarded messages, date the original message was sent in Unix time"""
|
||||||
is_automatic_forward: Optional[bool] = None
|
is_automatic_forward: Optional[bool] = None
|
||||||
"""*Optional*. True, if the message is a channel post that was automatically forwarded to the connected discussion group"""
|
"""*Optional*. :code:`True`, if the message is a channel post that was automatically forwarded to the connected discussion group"""
|
||||||
reply_to_message: Optional[Message] = None
|
reply_to_message: Optional[Message] = None
|
||||||
"""*Optional*. For replies, the original message. Note that the Message object in this field will not contain further *reply_to_message* fields even if it itself is a reply."""
|
"""*Optional*. For replies, the original message. Note that the Message object in this field will not contain further *reply_to_message* fields even if it itself is a reply."""
|
||||||
via_bot: Optional[User] = None
|
via_bot: Optional[User] = None
|
||||||
|
|
@ -110,13 +110,13 @@ class Message(TelegramObject):
|
||||||
edit_date: Optional[int] = None
|
edit_date: Optional[int] = None
|
||||||
"""*Optional*. Date the message was last edited in Unix time"""
|
"""*Optional*. Date the message was last edited in Unix time"""
|
||||||
has_protected_content: Optional[bool] = None
|
has_protected_content: Optional[bool] = None
|
||||||
"""*Optional*. True, if the message can't be forwarded"""
|
"""*Optional*. :code:`True`, if the message can't be forwarded"""
|
||||||
media_group_id: Optional[str] = None
|
media_group_id: Optional[str] = None
|
||||||
"""*Optional*. The unique identifier of a media message group this message belongs to"""
|
"""*Optional*. The unique identifier of a media message group this message belongs to"""
|
||||||
author_signature: Optional[str] = None
|
author_signature: Optional[str] = None
|
||||||
"""*Optional*. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator"""
|
"""*Optional*. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator"""
|
||||||
text: Optional[str] = None
|
text: Optional[str] = None
|
||||||
"""*Optional*. For text messages, the actual UTF-8 text of the message, 0-4096 characters"""
|
"""*Optional*. For text messages, the actual UTF-8 text of the message"""
|
||||||
entities: Optional[List[MessageEntity]] = None
|
entities: Optional[List[MessageEntity]] = None
|
||||||
"""*Optional*. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text"""
|
"""*Optional*. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text"""
|
||||||
animation: Optional[Animation] = None
|
animation: Optional[Animation] = None
|
||||||
|
|
@ -136,7 +136,7 @@ class Message(TelegramObject):
|
||||||
voice: Optional[Voice] = None
|
voice: Optional[Voice] = None
|
||||||
"""*Optional*. Message is a voice message, information about the file"""
|
"""*Optional*. Message is a voice message, information about the file"""
|
||||||
caption: Optional[str] = None
|
caption: Optional[str] = None
|
||||||
"""*Optional*. Caption for the animation, audio, document, photo, video or voice, 0-1024 characters"""
|
"""*Optional*. Caption for the animation, audio, document, photo, video or voice"""
|
||||||
caption_entities: Optional[List[MessageEntity]] = None
|
caption_entities: Optional[List[MessageEntity]] = None
|
||||||
"""*Optional*. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption"""
|
"""*Optional*. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption"""
|
||||||
contact: Optional[Contact] = None
|
contact: Optional[Contact] = None
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ class MessageEntity(MutableTelegramObject):
|
||||||
length: int
|
length: int
|
||||||
"""Length of the entity in UTF-16 code units"""
|
"""Length of the entity in UTF-16 code units"""
|
||||||
url: Optional[str] = None
|
url: Optional[str] = None
|
||||||
"""*Optional*. For 'text_link' only, url that will be opened after user taps on the text"""
|
"""*Optional*. For 'text_link' only, URL that will be opened after user taps on the text"""
|
||||||
user: Optional[User] = None
|
user: Optional[User] = None
|
||||||
"""*Optional*. For 'text_mention' only, the mentioned user"""
|
"""*Optional*. For 'text_mention' only, the mentioned user"""
|
||||||
language: Optional[str] = None
|
language: Optional[str] = None
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ if TYPE_CHECKING:
|
||||||
|
|
||||||
class PassportData(TelegramObject):
|
class PassportData(TelegramObject):
|
||||||
"""
|
"""
|
||||||
Contains information about Telegram Passport data shared with the bot by the user.
|
Describes Telegram Passport data shared with the bot by the user.
|
||||||
|
|
||||||
Source: https://core.telegram.org/bots/api#passportdata
|
Source: https://core.telegram.org/bots/api#passportdata
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ class PreCheckoutQuery(TelegramObject):
|
||||||
shipping_option_id: Optional[str] = None
|
shipping_option_id: Optional[str] = None
|
||||||
"""*Optional*. Identifier of the shipping option chosen by the user"""
|
"""*Optional*. Identifier of the shipping option chosen by the user"""
|
||||||
order_info: Optional[OrderInfo] = None
|
order_info: Optional[OrderInfo] = None
|
||||||
"""*Optional*. Order info provided by the user"""
|
"""*Optional*. Order information provided by the user"""
|
||||||
|
|
||||||
def answer(self, ok: bool, error_message: Optional[str] = None) -> AnswerPreCheckoutQuery:
|
def answer(self, ok: bool, error_message: Optional[str] = None) -> AnswerPreCheckoutQuery:
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ class ReplyKeyboardMarkup(MutableTelegramObject):
|
||||||
resize_keyboard: Optional[bool] = None
|
resize_keyboard: Optional[bool] = None
|
||||||
"""*Optional*. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to *false*, in which case the custom keyboard is always of the same height as the app's standard keyboard."""
|
"""*Optional*. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to *false*, in which case the custom keyboard is always of the same height as the app's standard keyboard."""
|
||||||
one_time_keyboard: Optional[bool] = None
|
one_time_keyboard: Optional[bool] = None
|
||||||
"""*Optional*. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat – the user can press a special button in the input field to see the custom keyboard again. Defaults to *false*."""
|
"""*Optional*. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again. Defaults to *false*."""
|
||||||
input_field_placeholder: Optional[str] = None
|
input_field_placeholder: Optional[str] = None
|
||||||
"""*Optional*. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters"""
|
"""*Optional*. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters"""
|
||||||
selective: Optional[bool] = None
|
selective: Optional[bool] = None
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ from .base import TelegramObject
|
||||||
|
|
||||||
class ResponseParameters(TelegramObject):
|
class ResponseParameters(TelegramObject):
|
||||||
"""
|
"""
|
||||||
Contains information about why a request was unsuccessful.
|
Describes why a request was unsuccessful.
|
||||||
|
|
||||||
Source: https://core.telegram.org/bots/api#responseparameters
|
Source: https://core.telegram.org/bots/api#responseparameters
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ from .base import TelegramObject
|
||||||
|
|
||||||
class SentWebAppMessage(TelegramObject):
|
class SentWebAppMessage(TelegramObject):
|
||||||
"""
|
"""
|
||||||
Contains information about an inline message sent by a `Web App <https://core.telegram.org/bots/webapps>`_ on behalf of a user.
|
Describes an inline message sent by a `Web App <https://core.telegram.org/bots/webapps>`_ on behalf of a user.
|
||||||
|
|
||||||
Source: https://core.telegram.org/bots/api#sentwebappmessage
|
Source: https://core.telegram.org/bots/api#sentwebappmessage
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ class ShippingAddress(TelegramObject):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
country_code: str
|
country_code: str
|
||||||
"""ISO 3166-1 alpha-2 country code"""
|
"""Two-letter ISO 3166-1 alpha-2 country code"""
|
||||||
state: str
|
state: str
|
||||||
"""State, if applicable"""
|
"""State, if applicable"""
|
||||||
city: str
|
city: str
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ from typing import TYPE_CHECKING, Optional
|
||||||
from .base import TelegramObject
|
from .base import TelegramObject
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
from .file import File
|
||||||
from .mask_position import MaskPosition
|
from .mask_position import MaskPosition
|
||||||
from .photo_size import PhotoSize
|
from .photo_size import PhotoSize
|
||||||
|
|
||||||
|
|
@ -34,6 +35,8 @@ class Sticker(TelegramObject):
|
||||||
"""*Optional*. Emoji associated with the sticker"""
|
"""*Optional*. Emoji associated with the sticker"""
|
||||||
set_name: Optional[str] = None
|
set_name: Optional[str] = None
|
||||||
"""*Optional*. Name of the sticker set to which the sticker belongs"""
|
"""*Optional*. Name of the sticker set to which the sticker belongs"""
|
||||||
|
premium_animation: Optional[File] = None
|
||||||
|
"""*Optional*. Premium animation for the sticker, if the sticker is premium"""
|
||||||
mask_position: Optional[MaskPosition] = None
|
mask_position: Optional[MaskPosition] = None
|
||||||
"""*Optional*. For mask stickers, the position where the mask should be placed"""
|
"""*Optional*. For mask stickers, the position where the mask should be placed"""
|
||||||
file_size: Optional[int] = None
|
file_size: Optional[int] = None
|
||||||
|
|
|
||||||
|
|
@ -28,4 +28,4 @@ class SuccessfulPayment(TelegramObject):
|
||||||
shipping_option_id: Optional[str] = None
|
shipping_option_id: Optional[str] = None
|
||||||
"""*Optional*. Identifier of the shipping option chosen by the user"""
|
"""*Optional*. Identifier of the shipping option chosen by the user"""
|
||||||
order_info: Optional[OrderInfo] = None
|
order_info: Optional[OrderInfo] = None
|
||||||
"""*Optional*. Order info provided by the user"""
|
"""*Optional*. Order information provided by the user"""
|
||||||
|
|
|
||||||
|
|
@ -28,13 +28,13 @@ class Update(TelegramObject):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
update_id: int
|
update_id: int
|
||||||
"""The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you're using `Webhooks <https://core.telegram.org/bots/api#setwebhook>`_, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially."""
|
"""The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you're using `webhooks <https://core.telegram.org/bots/api#setwebhook>`_, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially."""
|
||||||
message: Optional[Message] = None
|
message: Optional[Message] = None
|
||||||
"""*Optional*. New incoming message of any kind — text, photo, sticker, etc."""
|
"""*Optional*. New incoming message of any kind - text, photo, sticker, etc."""
|
||||||
edited_message: Optional[Message] = None
|
edited_message: Optional[Message] = None
|
||||||
"""*Optional*. New version of a message that is known to the bot and was edited"""
|
"""*Optional*. New version of a message that is known to the bot and was edited"""
|
||||||
channel_post: Optional[Message] = None
|
channel_post: Optional[Message] = None
|
||||||
"""*Optional*. New incoming channel post of any kind — text, photo, sticker, etc."""
|
"""*Optional*. New incoming channel post of any kind - text, photo, sticker, etc."""
|
||||||
edited_channel_post: Optional[Message] = None
|
edited_channel_post: Optional[Message] = None
|
||||||
"""*Optional*. New version of a channel post that is known to the bot and was edited"""
|
"""*Optional*. New version of a channel post that is known to the bot and was edited"""
|
||||||
inline_query: Optional[InlineQuery] = None
|
inline_query: Optional[InlineQuery] = None
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,10 @@ class User(TelegramObject):
|
||||||
"""*Optional*. User's or bot's username"""
|
"""*Optional*. User's or bot's username"""
|
||||||
language_code: Optional[str] = None
|
language_code: Optional[str] = None
|
||||||
"""*Optional*. `IETF language tag <https://en.wikipedia.org/wiki/IETF_language_tag>`_ of the user's language"""
|
"""*Optional*. `IETF language tag <https://en.wikipedia.org/wiki/IETF_language_tag>`_ of the user's language"""
|
||||||
|
is_premium: Optional[bool] = None
|
||||||
|
"""*Optional*. :code:`True`, if this user is a Telegram Premium user"""
|
||||||
|
added_to_attachment_menu: Optional[bool] = None
|
||||||
|
"""*Optional*. :code:`True`, if this user added the bot to the attachment menu"""
|
||||||
can_join_groups: Optional[bool] = None
|
can_join_groups: Optional[bool] = None
|
||||||
"""*Optional*. :code:`True`, if the bot can be invited to groups. Returned only in :class:`aiogram.methods.get_me.GetMe`."""
|
"""*Optional*. :code:`True`, if the bot can be invited to groups. Returned only in :class:`aiogram.methods.get_me.GetMe`."""
|
||||||
can_read_all_group_messages: Optional[bool] = None
|
can_read_all_group_messages: Optional[bool] = None
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,6 @@ class Video(TelegramObject):
|
||||||
file_name: Optional[str] = None
|
file_name: Optional[str] = None
|
||||||
"""*Optional*. Original filename as defined by sender"""
|
"""*Optional*. Original filename as defined by sender"""
|
||||||
mime_type: Optional[str] = None
|
mime_type: Optional[str] = None
|
||||||
"""*Optional*. Mime type of a file as defined by sender"""
|
"""*Optional*. MIME type of the file as defined by sender"""
|
||||||
file_size: Optional[int] = None
|
file_size: Optional[int] = None
|
||||||
"""*Optional*. File size in bytes"""
|
"""*Optional*. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."""
|
||||||
|
|
|
||||||
|
|
@ -21,4 +21,4 @@ class Voice(TelegramObject):
|
||||||
mime_type: Optional[str] = None
|
mime_type: Optional[str] = None
|
||||||
"""*Optional*. MIME type of the file as defined by sender"""
|
"""*Optional*. MIME type of the file as defined by sender"""
|
||||||
file_size: Optional[int] = None
|
file_size: Optional[int] = None
|
||||||
"""*Optional*. File size in bytes"""
|
"""*Optional*. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."""
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ from .base import TelegramObject
|
||||||
|
|
||||||
class WebAppData(TelegramObject):
|
class WebAppData(TelegramObject):
|
||||||
"""
|
"""
|
||||||
Contains data sent from a `Web App <https://core.telegram.org/bots/webapps>`_ to the bot.
|
Describes data sent from a `Web App <https://core.telegram.org/bots/webapps>`_ to the bot.
|
||||||
|
|
||||||
Source: https://core.telegram.org/bots/api#webappdata
|
Source: https://core.telegram.org/bots/api#webappdata
|
||||||
"""
|
"""
|
||||||
|
|
@ -13,4 +13,4 @@ class WebAppData(TelegramObject):
|
||||||
data: str
|
data: str
|
||||||
"""The data. Be aware that a bad client can send arbitrary data in this field."""
|
"""The data. Be aware that a bad client can send arbitrary data in this field."""
|
||||||
button_text: str
|
button_text: str
|
||||||
"""Text of the *web_app* keyboard button, from which the Web App was opened. Be aware that a bad client can send arbitrary data in this field."""
|
"""Text of the *web_app* keyboard button from which the Web App was opened. Be aware that a bad client can send arbitrary data in this field."""
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ from .base import TelegramObject
|
||||||
|
|
||||||
class WebAppInfo(TelegramObject):
|
class WebAppInfo(TelegramObject):
|
||||||
"""
|
"""
|
||||||
Contains information about a `Web App <https://core.telegram.org/bots/webapps>`_.
|
Describes a `Web App <https://core.telegram.org/bots/webapps>`_.
|
||||||
|
|
||||||
Source: https://core.telegram.org/bots/api#webappinfo
|
Source: https://core.telegram.org/bots/api#webappinfo
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
from typing import List, Optional, Union
|
from typing import List, Optional
|
||||||
|
|
||||||
from .base import TelegramObject
|
from .base import TelegramObject
|
||||||
|
|
||||||
|
|
||||||
class WebhookInfo(TelegramObject):
|
class WebhookInfo(TelegramObject):
|
||||||
"""
|
"""
|
||||||
Contains information about the current status of a webhook.
|
Describes the current status of a webhook.
|
||||||
|
|
||||||
Source: https://core.telegram.org/bots/api#webhookinfo
|
Source: https://core.telegram.org/bots/api#webhookinfo
|
||||||
"""
|
"""
|
||||||
|
|
@ -21,13 +21,13 @@ class WebhookInfo(TelegramObject):
|
||||||
"""Number of updates awaiting delivery"""
|
"""Number of updates awaiting delivery"""
|
||||||
ip_address: Optional[str] = None
|
ip_address: Optional[str] = None
|
||||||
"""*Optional*. Currently used webhook IP address"""
|
"""*Optional*. Currently used webhook IP address"""
|
||||||
last_error_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None
|
last_error_date: Optional[datetime.datetime] = None
|
||||||
"""*Optional*. Unix time for the most recent error that happened when trying to deliver an update via webhook"""
|
"""*Optional*. Unix time for the most recent error that happened when trying to deliver an update via webhook"""
|
||||||
last_error_message: Optional[str] = None
|
last_error_message: Optional[str] = None
|
||||||
"""*Optional*. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook"""
|
"""*Optional*. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook"""
|
||||||
last_synchronization_error_date: Optional[datetime.datetime] = None
|
last_synchronization_error_date: Optional[datetime.datetime] = None
|
||||||
"""*Optional*. Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters"""
|
"""*Optional*. Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters"""
|
||||||
max_connections: Optional[int] = None
|
max_connections: Optional[int] = None
|
||||||
"""*Optional*. Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery"""
|
"""*Optional*. The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery"""
|
||||||
allowed_updates: Optional[List[str]] = None
|
allowed_updates: Optional[List[str]] = None
|
||||||
"""*Optional*. A list of update types the bot is subscribed to. Defaults to all update types except *chat_member*"""
|
"""*Optional*. A list of update types the bot is subscribed to. Defaults to all update types except *chat_member*"""
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ class I18n(ContextInstanceMixin["I18n"]):
|
||||||
|
|
||||||
if os.path.exists(mo_path):
|
if os.path.exists(mo_path):
|
||||||
with open(mo_path, "rb") as fp:
|
with open(mo_path, "rb") as fp:
|
||||||
translations[name] = gettext.GNUTranslations(fp) # type: ignore
|
translations[name] = gettext.GNUTranslations(fp)
|
||||||
elif os.path.exists(mo_path[:-2] + "po"): # pragma: no cover
|
elif os.path.exists(mo_path[:-2] + "po"): # pragma: no cover
|
||||||
raise RuntimeError(f"Found locale '{name}' but this language is not compiled!")
|
raise RuntimeError(f"Found locale '{name}' but this language is not compiled!")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,6 @@ Imports:
|
||||||
- :code:`from aiogram.methods.add_sticker_to_set import AddStickerToSet`
|
- :code:`from aiogram.methods.add_sticker_to_set import AddStickerToSet`
|
||||||
- alias: :code:`from aiogram.methods import AddStickerToSet`
|
- alias: :code:`from aiogram.methods import AddStickerToSet`
|
||||||
|
|
||||||
In handlers with current bot
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
result: bool = await AddStickerToSet(...)
|
|
||||||
|
|
||||||
With specific bot
|
With specific bot
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,6 @@ Imports:
|
||||||
- :code:`from aiogram.methods.answer_callback_query import AnswerCallbackQuery`
|
- :code:`from aiogram.methods.answer_callback_query import AnswerCallbackQuery`
|
||||||
- alias: :code:`from aiogram.methods import AnswerCallbackQuery`
|
- alias: :code:`from aiogram.methods import AnswerCallbackQuery`
|
||||||
|
|
||||||
In handlers with current bot
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
result: bool = await AnswerCallbackQuery(...)
|
|
||||||
|
|
||||||
With specific bot
|
With specific bot
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,6 @@ Imports:
|
||||||
- :code:`from aiogram.methods.answer_inline_query import AnswerInlineQuery`
|
- :code:`from aiogram.methods.answer_inline_query import AnswerInlineQuery`
|
||||||
- alias: :code:`from aiogram.methods import AnswerInlineQuery`
|
- alias: :code:`from aiogram.methods import AnswerInlineQuery`
|
||||||
|
|
||||||
In handlers with current bot
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
result: bool = await AnswerInlineQuery(...)
|
|
||||||
|
|
||||||
With specific bot
|
With specific bot
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,6 @@ Imports:
|
||||||
- :code:`from aiogram.methods.answer_pre_checkout_query import AnswerPreCheckoutQuery`
|
- :code:`from aiogram.methods.answer_pre_checkout_query import AnswerPreCheckoutQuery`
|
||||||
- alias: :code:`from aiogram.methods import AnswerPreCheckoutQuery`
|
- alias: :code:`from aiogram.methods import AnswerPreCheckoutQuery`
|
||||||
|
|
||||||
In handlers with current bot
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
result: bool = await AnswerPreCheckoutQuery(...)
|
|
||||||
|
|
||||||
With specific bot
|
With specific bot
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,6 @@ Imports:
|
||||||
- :code:`from aiogram.methods.answer_shipping_query import AnswerShippingQuery`
|
- :code:`from aiogram.methods.answer_shipping_query import AnswerShippingQuery`
|
||||||
- alias: :code:`from aiogram.methods import AnswerShippingQuery`
|
- alias: :code:`from aiogram.methods import AnswerShippingQuery`
|
||||||
|
|
||||||
In handlers with current bot
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
result: bool = await AnswerShippingQuery(...)
|
|
||||||
|
|
||||||
With specific bot
|
With specific bot
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,6 @@ Imports:
|
||||||
- :code:`from aiogram.methods.answer_web_app_query import AnswerWebAppQuery`
|
- :code:`from aiogram.methods.answer_web_app_query import AnswerWebAppQuery`
|
||||||
- alias: :code:`from aiogram.methods import AnswerWebAppQuery`
|
- alias: :code:`from aiogram.methods import AnswerWebAppQuery`
|
||||||
|
|
||||||
In handlers with current bot
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
result: SentWebAppMessage = await AnswerWebAppQuery(...)
|
|
||||||
|
|
||||||
With specific bot
|
With specific bot
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,6 @@ Imports:
|
||||||
- :code:`from aiogram.methods.approve_chat_join_request import ApproveChatJoinRequest`
|
- :code:`from aiogram.methods.approve_chat_join_request import ApproveChatJoinRequest`
|
||||||
- alias: :code:`from aiogram.methods import ApproveChatJoinRequest`
|
- alias: :code:`from aiogram.methods import ApproveChatJoinRequest`
|
||||||
|
|
||||||
In handlers with current bot
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
result: bool = await ApproveChatJoinRequest(...)
|
|
||||||
|
|
||||||
With specific bot
|
With specific bot
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,6 @@ Imports:
|
||||||
- :code:`from aiogram.methods.ban_chat_member import BanChatMember`
|
- :code:`from aiogram.methods.ban_chat_member import BanChatMember`
|
||||||
- alias: :code:`from aiogram.methods import BanChatMember`
|
- alias: :code:`from aiogram.methods import BanChatMember`
|
||||||
|
|
||||||
In handlers with current bot
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
result: bool = await BanChatMember(...)
|
|
||||||
|
|
||||||
With specific bot
|
With specific bot
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,6 @@ Imports:
|
||||||
- :code:`from aiogram.methods.ban_chat_sender_chat import BanChatSenderChat`
|
- :code:`from aiogram.methods.ban_chat_sender_chat import BanChatSenderChat`
|
||||||
- alias: :code:`from aiogram.methods import BanChatSenderChat`
|
- alias: :code:`from aiogram.methods import BanChatSenderChat`
|
||||||
|
|
||||||
In handlers with current bot
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
result: bool = await BanChatSenderChat(...)
|
|
||||||
|
|
||||||
With specific bot
|
With specific bot
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,6 @@ Imports:
|
||||||
- :code:`from aiogram.methods.close import Close`
|
- :code:`from aiogram.methods.close import Close`
|
||||||
- alias: :code:`from aiogram.methods import Close`
|
- alias: :code:`from aiogram.methods import Close`
|
||||||
|
|
||||||
In handlers with current bot
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
result: bool = await Close(...)
|
|
||||||
|
|
||||||
With specific bot
|
With specific bot
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,6 @@ Imports:
|
||||||
- :code:`from aiogram.methods.copy_message import CopyMessage`
|
- :code:`from aiogram.methods.copy_message import CopyMessage`
|
||||||
- alias: :code:`from aiogram.methods import CopyMessage`
|
- alias: :code:`from aiogram.methods import CopyMessage`
|
||||||
|
|
||||||
In handlers with current bot
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
result: MessageId = await CopyMessage(...)
|
|
||||||
|
|
||||||
With specific bot
|
With specific bot
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,6 @@ Imports:
|
||||||
- :code:`from aiogram.methods.create_chat_invite_link import CreateChatInviteLink`
|
- :code:`from aiogram.methods.create_chat_invite_link import CreateChatInviteLink`
|
||||||
- alias: :code:`from aiogram.methods import CreateChatInviteLink`
|
- alias: :code:`from aiogram.methods import CreateChatInviteLink`
|
||||||
|
|
||||||
In handlers with current bot
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
result: ChatInviteLink = await CreateChatInviteLink(...)
|
|
||||||
|
|
||||||
With specific bot
|
With specific bot
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
||||||
44
docs/api/methods/create_invoice_link.rst
Normal file
44
docs/api/methods/create_invoice_link.rst
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
#################
|
||||||
|
createInvoiceLink
|
||||||
|
#################
|
||||||
|
|
||||||
|
Returns: :obj:`str`
|
||||||
|
|
||||||
|
.. automodule:: aiogram.methods.create_invoice_link
|
||||||
|
:members:
|
||||||
|
:member-order: bysource
|
||||||
|
:undoc-members: True
|
||||||
|
|
||||||
|
|
||||||
|
Usage
|
||||||
|
=====
|
||||||
|
|
||||||
|
As bot method
|
||||||
|
-------------
|
||||||
|
|
||||||
|
.. code-block::
|
||||||
|
|
||||||
|
result: str = await bot.create_invoice_link(...)
|
||||||
|
|
||||||
|
|
||||||
|
Method as object
|
||||||
|
----------------
|
||||||
|
|
||||||
|
Imports:
|
||||||
|
|
||||||
|
- :code:`from aiogram.methods.create_invoice_link import CreateInvoiceLink`
|
||||||
|
- alias: :code:`from aiogram.methods import CreateInvoiceLink`
|
||||||
|
|
||||||
|
With specific bot
|
||||||
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
result: str = await bot(CreateInvoiceLink(...))
|
||||||
|
|
||||||
|
As reply into Webhook in handler
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
return CreateInvoiceLink(...)
|
||||||
|
|
@ -29,13 +29,6 @@ Imports:
|
||||||
- :code:`from aiogram.methods.create_new_sticker_set import CreateNewStickerSet`
|
- :code:`from aiogram.methods.create_new_sticker_set import CreateNewStickerSet`
|
||||||
- alias: :code:`from aiogram.methods import CreateNewStickerSet`
|
- alias: :code:`from aiogram.methods import CreateNewStickerSet`
|
||||||
|
|
||||||
In handlers with current bot
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
result: bool = await CreateNewStickerSet(...)
|
|
||||||
|
|
||||||
With specific bot
|
With specific bot
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,6 @@ Imports:
|
||||||
- :code:`from aiogram.methods.decline_chat_join_request import DeclineChatJoinRequest`
|
- :code:`from aiogram.methods.decline_chat_join_request import DeclineChatJoinRequest`
|
||||||
- alias: :code:`from aiogram.methods import DeclineChatJoinRequest`
|
- alias: :code:`from aiogram.methods import DeclineChatJoinRequest`
|
||||||
|
|
||||||
In handlers with current bot
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
result: bool = await DeclineChatJoinRequest(...)
|
|
||||||
|
|
||||||
With specific bot
|
With specific bot
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,6 @@ Imports:
|
||||||
- :code:`from aiogram.methods.delete_chat_photo import DeleteChatPhoto`
|
- :code:`from aiogram.methods.delete_chat_photo import DeleteChatPhoto`
|
||||||
- alias: :code:`from aiogram.methods import DeleteChatPhoto`
|
- alias: :code:`from aiogram.methods import DeleteChatPhoto`
|
||||||
|
|
||||||
In handlers with current bot
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
result: bool = await DeleteChatPhoto(...)
|
|
||||||
|
|
||||||
With specific bot
|
With specific bot
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,6 @@ Imports:
|
||||||
- :code:`from aiogram.methods.delete_chat_sticker_set import DeleteChatStickerSet`
|
- :code:`from aiogram.methods.delete_chat_sticker_set import DeleteChatStickerSet`
|
||||||
- alias: :code:`from aiogram.methods import DeleteChatStickerSet`
|
- alias: :code:`from aiogram.methods import DeleteChatStickerSet`
|
||||||
|
|
||||||
In handlers with current bot
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
result: bool = await DeleteChatStickerSet(...)
|
|
||||||
|
|
||||||
With specific bot
|
With specific bot
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,6 @@ Imports:
|
||||||
- :code:`from aiogram.methods.delete_message import DeleteMessage`
|
- :code:`from aiogram.methods.delete_message import DeleteMessage`
|
||||||
- alias: :code:`from aiogram.methods import DeleteMessage`
|
- alias: :code:`from aiogram.methods import DeleteMessage`
|
||||||
|
|
||||||
In handlers with current bot
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
result: bool = await DeleteMessage(...)
|
|
||||||
|
|
||||||
With specific bot
|
With specific bot
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,6 @@ Imports:
|
||||||
- :code:`from aiogram.methods.delete_my_commands import DeleteMyCommands`
|
- :code:`from aiogram.methods.delete_my_commands import DeleteMyCommands`
|
||||||
- alias: :code:`from aiogram.methods import DeleteMyCommands`
|
- alias: :code:`from aiogram.methods import DeleteMyCommands`
|
||||||
|
|
||||||
In handlers with current bot
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
result: bool = await DeleteMyCommands(...)
|
|
||||||
|
|
||||||
With specific bot
|
With specific bot
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,6 @@ Imports:
|
||||||
- :code:`from aiogram.methods.delete_sticker_from_set import DeleteStickerFromSet`
|
- :code:`from aiogram.methods.delete_sticker_from_set import DeleteStickerFromSet`
|
||||||
- alias: :code:`from aiogram.methods import DeleteStickerFromSet`
|
- alias: :code:`from aiogram.methods import DeleteStickerFromSet`
|
||||||
|
|
||||||
In handlers with current bot
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
result: bool = await DeleteStickerFromSet(...)
|
|
||||||
|
|
||||||
With specific bot
|
With specific bot
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,6 @@ Imports:
|
||||||
- :code:`from aiogram.methods.delete_webhook import DeleteWebhook`
|
- :code:`from aiogram.methods.delete_webhook import DeleteWebhook`
|
||||||
- alias: :code:`from aiogram.methods import DeleteWebhook`
|
- alias: :code:`from aiogram.methods import DeleteWebhook`
|
||||||
|
|
||||||
In handlers with current bot
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
result: bool = await DeleteWebhook(...)
|
|
||||||
|
|
||||||
With specific bot
|
With specific bot
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,6 @@ Imports:
|
||||||
- :code:`from aiogram.methods.edit_chat_invite_link import EditChatInviteLink`
|
- :code:`from aiogram.methods.edit_chat_invite_link import EditChatInviteLink`
|
||||||
- alias: :code:`from aiogram.methods import EditChatInviteLink`
|
- alias: :code:`from aiogram.methods import EditChatInviteLink`
|
||||||
|
|
||||||
In handlers with current bot
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
result: ChatInviteLink = await EditChatInviteLink(...)
|
|
||||||
|
|
||||||
With specific bot
|
With specific bot
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,6 @@ Imports:
|
||||||
- :code:`from aiogram.methods.edit_message_caption import EditMessageCaption`
|
- :code:`from aiogram.methods.edit_message_caption import EditMessageCaption`
|
||||||
- alias: :code:`from aiogram.methods import EditMessageCaption`
|
- alias: :code:`from aiogram.methods import EditMessageCaption`
|
||||||
|
|
||||||
In handlers with current bot
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
result: Union[Message, bool] = await EditMessageCaption(...)
|
|
||||||
|
|
||||||
With specific bot
|
With specific bot
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,6 @@ Imports:
|
||||||
- :code:`from aiogram.methods.edit_message_live_location import EditMessageLiveLocation`
|
- :code:`from aiogram.methods.edit_message_live_location import EditMessageLiveLocation`
|
||||||
- alias: :code:`from aiogram.methods import EditMessageLiveLocation`
|
- alias: :code:`from aiogram.methods import EditMessageLiveLocation`
|
||||||
|
|
||||||
In handlers with current bot
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
result: Union[Message, bool] = await EditMessageLiveLocation(...)
|
|
||||||
|
|
||||||
With specific bot
|
With specific bot
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,6 @@ Imports:
|
||||||
- :code:`from aiogram.methods.edit_message_media import EditMessageMedia`
|
- :code:`from aiogram.methods.edit_message_media import EditMessageMedia`
|
||||||
- alias: :code:`from aiogram.methods import EditMessageMedia`
|
- alias: :code:`from aiogram.methods import EditMessageMedia`
|
||||||
|
|
||||||
In handlers with current bot
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
result: Union[Message, bool] = await EditMessageMedia(...)
|
|
||||||
|
|
||||||
With specific bot
|
With specific bot
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,6 @@ Imports:
|
||||||
- :code:`from aiogram.methods.edit_message_reply_markup import EditMessageReplyMarkup`
|
- :code:`from aiogram.methods.edit_message_reply_markup import EditMessageReplyMarkup`
|
||||||
- alias: :code:`from aiogram.methods import EditMessageReplyMarkup`
|
- alias: :code:`from aiogram.methods import EditMessageReplyMarkup`
|
||||||
|
|
||||||
In handlers with current bot
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
result: Union[Message, bool] = await EditMessageReplyMarkup(...)
|
|
||||||
|
|
||||||
With specific bot
|
With specific bot
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,6 @@ Imports:
|
||||||
- :code:`from aiogram.methods.edit_message_text import EditMessageText`
|
- :code:`from aiogram.methods.edit_message_text import EditMessageText`
|
||||||
- alias: :code:`from aiogram.methods import EditMessageText`
|
- alias: :code:`from aiogram.methods import EditMessageText`
|
||||||
|
|
||||||
In handlers with current bot
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
result: Union[Message, bool] = await EditMessageText(...)
|
|
||||||
|
|
||||||
With specific bot
|
With specific bot
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue