mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Bot API 6.3 (#1063)
* Added API changes * Added changelog * Oops. Move changelog * Update tests * Remove experimental * Added message content type * Update message aliases * Update changes * Update texts * Bump version * Remove versionadded badge
This commit is contained in:
parent
3ae5d904c9
commit
b287551590
275 changed files with 5821 additions and 1133 deletions
|
|
@ -1 +1 @@
|
|||
6.2
|
||||
6.3
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Fix typehints for `Message` `reply_media_group` & `answer_media_group` methods
|
||||
Fix typehints for :code:`Message`, :code:`reply_media_group` and :code:`answer_media_group` methods
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
Added following methods to ``Message`` class:
|
||||
|
||||
- ``Message.forward(...)``
|
||||
- ``Message.edit_media(...)``
|
||||
- ``Message.edit_live_location(...)``
|
||||
- ``Message.stop_live_location(...)``
|
||||
- ``Message.pin(...)``
|
||||
- ``Message.unpin()``
|
||||
- :code:`Message.forward(...)`
|
||||
- :code:`Message.edit_media(...)`
|
||||
- :code:`Message.edit_live_location(...)`
|
||||
- :code:`Message.stop_live_location(...)`
|
||||
- :code:`Message.pin(...)`
|
||||
- :code:`Message.unpin()`
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
Added following methods to ``User`` class:
|
||||
Added following methods to :code:`User` class:
|
||||
|
||||
- ``User.mention_markdown(...)``
|
||||
- ``User.mention_html(...)``
|
||||
- :code:`User.mention_markdown(...)`
|
||||
- :code:`User.mention_html(...)`
|
||||
|
|
|
|||
1
CHANGES/1057.feature.rst
Normal file
1
CHANGES/1057.feature.rst
Normal file
|
|
@ -0,0 +1 @@
|
|||
Added full support of `Bot API 6.3 <https://core.telegram.org/bots/api-changelog#november-5-2022>`_
|
||||
|
|
@ -13,7 +13,7 @@ aiogram |beta badge|
|
|||
:target: https://pypi.python.org/pypi/aiogram
|
||||
:alt: Supported python versions
|
||||
|
||||
.. image:: https://img.shields.io/badge/Telegram%20Bot%20API-6.2-blue.svg?logo=telegram
|
||||
.. image:: https://img.shields.io/badge/Telegram%20Bot%20API-6.3-blue.svg?logo=telegram
|
||||
:target: https://core.telegram.org/bots/api
|
||||
:alt: Telegram Bot API
|
||||
|
||||
|
|
|
|||
|
|
@ -35,5 +35,5 @@ __all__ = (
|
|||
"flags",
|
||||
)
|
||||
|
||||
__version__ = "3.0.0b5"
|
||||
__api_version__ = "6.2"
|
||||
__version__ = "3.0.0b6"
|
||||
__api_version__ = "6.3"
|
||||
|
|
|
|||
|
|
@ -32,18 +32,22 @@ from ..methods import (
|
|||
BanChatMember,
|
||||
BanChatSenderChat,
|
||||
Close,
|
||||
CloseForumTopic,
|
||||
CopyMessage,
|
||||
CreateChatInviteLink,
|
||||
CreateForumTopic,
|
||||
CreateInvoiceLink,
|
||||
CreateNewStickerSet,
|
||||
DeclineChatJoinRequest,
|
||||
DeleteChatPhoto,
|
||||
DeleteChatStickerSet,
|
||||
DeleteForumTopic,
|
||||
DeleteMessage,
|
||||
DeleteMyCommands,
|
||||
DeleteStickerFromSet,
|
||||
DeleteWebhook,
|
||||
EditChatInviteLink,
|
||||
EditForumTopic,
|
||||
EditMessageCaption,
|
||||
EditMessageLiveLocation,
|
||||
EditMessageMedia,
|
||||
|
|
@ -59,6 +63,7 @@ from ..methods import (
|
|||
GetChatMenuButton,
|
||||
GetCustomEmojiStickers,
|
||||
GetFile,
|
||||
GetForumTopicIconStickers,
|
||||
GetGameHighScores,
|
||||
GetMe,
|
||||
GetMyCommands,
|
||||
|
|
@ -72,6 +77,7 @@ from ..methods import (
|
|||
LogOut,
|
||||
PinChatMessage,
|
||||
PromoteChatMember,
|
||||
ReopenForumTopic,
|
||||
RestrictChatMember,
|
||||
RevokeChatInviteLink,
|
||||
SendAnimation,
|
||||
|
|
@ -112,6 +118,7 @@ from ..methods import (
|
|||
UnbanChatMember,
|
||||
UnbanChatSenderChat,
|
||||
UnpinAllChatMessages,
|
||||
UnpinAllForumTopicMessages,
|
||||
UnpinChatMessage,
|
||||
UploadStickerFile,
|
||||
)
|
||||
|
|
@ -132,6 +139,7 @@ from ..types import (
|
|||
Downloadable,
|
||||
File,
|
||||
ForceReply,
|
||||
ForumTopic,
|
||||
GameHighScore,
|
||||
InlineKeyboardMarkup,
|
||||
InlineQueryResult,
|
||||
|
|
@ -143,7 +151,9 @@ from ..types import (
|
|||
InputMediaVideo,
|
||||
LabeledPrice,
|
||||
MaskPosition,
|
||||
MenuButton,
|
||||
MenuButtonCommands,
|
||||
MenuButtonDefault,
|
||||
MenuButtonWebApp,
|
||||
Message,
|
||||
MessageEntity,
|
||||
MessageId,
|
||||
|
|
@ -548,6 +558,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
self,
|
||||
chat_id: Union[int, str],
|
||||
text: str,
|
||||
message_thread_id: Optional[int] = None,
|
||||
parse_mode: Optional[str] = UNSET,
|
||||
entities: Optional[List[MessageEntity]] = None,
|
||||
disable_web_page_preview: Optional[bool] = None,
|
||||
|
|
@ -567,6 +578,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 text: Text of the message to be sent, 1-4096 characters after entities parsing
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
:param parse_mode: Mode for parsing entities in the message text. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
||||
:param entities: A JSON-serialized list of special entities that appear in message text, which can be specified instead of *parse_mode*
|
||||
:param disable_web_page_preview: Disables link previews for links in this message
|
||||
|
|
@ -574,13 +586,14 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
: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 allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.
|
||||
:param request_timeout: Request timeout
|
||||
:return: On success, the sent Message is returned.
|
||||
"""
|
||||
call = SendMessage(
|
||||
chat_id=chat_id,
|
||||
text=text,
|
||||
message_thread_id=message_thread_id,
|
||||
parse_mode=parse_mode,
|
||||
entities=entities,
|
||||
disable_web_page_preview=disable_web_page_preview,
|
||||
|
|
@ -597,6 +610,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
chat_id: Union[int, str],
|
||||
from_chat_id: Union[int, str],
|
||||
message_id: int,
|
||||
message_thread_id: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
request_timeout: Optional[int] = None,
|
||||
|
|
@ -609,6 +623,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 from_chat_id: Unique identifier for the chat where the original message was sent (or channel username in the format :code:`@channelusername`)
|
||||
:param message_id: Message identifier in the chat specified in *from_chat_id*
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
: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 forwarded message from forwarding and saving
|
||||
:param request_timeout: Request timeout
|
||||
|
|
@ -618,6 +633,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
chat_id=chat_id,
|
||||
from_chat_id=from_chat_id,
|
||||
message_id=message_id,
|
||||
message_thread_id=message_thread_id,
|
||||
disable_notification=disable_notification,
|
||||
protect_content=protect_content,
|
||||
)
|
||||
|
|
@ -628,6 +644,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
chat_id: Union[int, str],
|
||||
from_chat_id: Union[int, str],
|
||||
message_id: int,
|
||||
message_thread_id: Optional[int] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
|
|
@ -648,6 +665,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 from_chat_id: Unique identifier for the chat where the original message was sent (or channel username in the format :code:`@channelusername`)
|
||||
:param message_id: Message identifier in the chat specified in *from_chat_id*
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
:param caption: New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept
|
||||
:param parse_mode: Mode for parsing entities in the new 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 new caption, which can be specified instead of *parse_mode*
|
||||
|
|
@ -655,7 +673,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
: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 allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns the MessageId of the sent message on success.
|
||||
"""
|
||||
|
|
@ -663,6 +681,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
chat_id=chat_id,
|
||||
from_chat_id=from_chat_id,
|
||||
message_id=message_id,
|
||||
message_thread_id=message_thread_id,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
|
|
@ -678,6 +697,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
self,
|
||||
chat_id: Union[int, str],
|
||||
photo: Union[InputFile, str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
|
|
@ -697,6 +717,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 photo: Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. :ref:`More information on Sending Files » <sending-files>`
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
: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 caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*
|
||||
|
|
@ -704,13 +725,14 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
: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 allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.
|
||||
:param request_timeout: Request timeout
|
||||
:return: On success, the sent Message is returned.
|
||||
"""
|
||||
call = SendPhoto(
|
||||
chat_id=chat_id,
|
||||
photo=photo,
|
||||
message_thread_id=message_thread_id,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
|
|
@ -726,6 +748,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
self,
|
||||
chat_id: Union[int, str],
|
||||
audio: Union[InputFile, str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
|
|
@ -750,6 +773,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 audio: Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
: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 caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*
|
||||
|
|
@ -761,13 +785,14 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
: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 allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.
|
||||
:param request_timeout: Request timeout
|
||||
:return: On success, the sent Message is returned.
|
||||
"""
|
||||
call = SendAudio(
|
||||
chat_id=chat_id,
|
||||
audio=audio,
|
||||
message_thread_id=message_thread_id,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
|
|
@ -787,6 +812,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
self,
|
||||
chat_id: Union[int, str],
|
||||
document: Union[InputFile, str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
thumb: Optional[Union[InputFile, str]] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET,
|
||||
|
|
@ -808,6 +834,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 document: File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
: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 parse_mode: Mode for parsing entities in the document caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
||||
|
|
@ -817,13 +844,14 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
: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 allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.
|
||||
:param request_timeout: Request timeout
|
||||
:return: On success, the sent Message is returned.
|
||||
"""
|
||||
call = SendDocument(
|
||||
chat_id=chat_id,
|
||||
document=document,
|
||||
message_thread_id=message_thread_id,
|
||||
thumb=thumb,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
|
|
@ -841,6 +869,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
self,
|
||||
chat_id: Union[int, str],
|
||||
video: Union[InputFile, str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
duration: Optional[int] = None,
|
||||
width: Optional[int] = None,
|
||||
height: Optional[int] = None,
|
||||
|
|
@ -865,6 +894,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 video: Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
:param duration: Duration of sent video in seconds
|
||||
:param width: Video width
|
||||
:param height: Video height
|
||||
|
|
@ -877,13 +907,14 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
: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 allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.
|
||||
:param request_timeout: Request timeout
|
||||
:return: On success, the sent Message is returned.
|
||||
"""
|
||||
call = SendVideo(
|
||||
chat_id=chat_id,
|
||||
video=video,
|
||||
message_thread_id=message_thread_id,
|
||||
duration=duration,
|
||||
width=width,
|
||||
height=height,
|
||||
|
|
@ -904,6 +935,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
self,
|
||||
chat_id: Union[int, str],
|
||||
animation: Union[InputFile, str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
duration: Optional[int] = None,
|
||||
width: Optional[int] = None,
|
||||
height: Optional[int] = None,
|
||||
|
|
@ -927,6 +959,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 animation: Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
:param duration: Duration of sent animation in seconds
|
||||
:param width: Animation width
|
||||
:param height: Animation height
|
||||
|
|
@ -938,13 +971,14 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
: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 allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.
|
||||
:param request_timeout: Request timeout
|
||||
:return: On success, the sent Message is returned.
|
||||
"""
|
||||
call = SendAnimation(
|
||||
chat_id=chat_id,
|
||||
animation=animation,
|
||||
message_thread_id=message_thread_id,
|
||||
duration=duration,
|
||||
width=width,
|
||||
height=height,
|
||||
|
|
@ -964,6 +998,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
self,
|
||||
chat_id: Union[int, str],
|
||||
voice: Union[InputFile, str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
|
|
@ -984,6 +1019,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 voice: Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
: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 caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*
|
||||
|
|
@ -992,13 +1028,14 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
: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 allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.
|
||||
:param request_timeout: Request timeout
|
||||
:return: On success, the sent Message is returned.
|
||||
"""
|
||||
call = SendVoice(
|
||||
chat_id=chat_id,
|
||||
voice=voice,
|
||||
message_thread_id=message_thread_id,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
|
|
@ -1015,6 +1052,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
self,
|
||||
chat_id: Union[int, str],
|
||||
video_note: Union[InputFile, str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
duration: Optional[int] = None,
|
||||
length: Optional[int] = None,
|
||||
thumb: Optional[Union[InputFile, str]] = None,
|
||||
|
|
@ -1034,6 +1072,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 video_note: Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`. Sending video notes by a URL is currently unsupported
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
:param duration: Duration of sent video in seconds
|
||||
: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 information on Sending Files » <sending-files>`
|
||||
|
|
@ -1041,13 +1080,14 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
: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 allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.
|
||||
:param request_timeout: Request timeout
|
||||
:return: On success, the sent Message is returned.
|
||||
"""
|
||||
call = SendVideoNote(
|
||||
chat_id=chat_id,
|
||||
video_note=video_note,
|
||||
message_thread_id=message_thread_id,
|
||||
duration=duration,
|
||||
length=length,
|
||||
thumb=thumb,
|
||||
|
|
@ -1063,6 +1103,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
self,
|
||||
chat_id: Union[int, str],
|
||||
media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]],
|
||||
message_thread_id: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
|
|
@ -1076,6 +1117,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 media: A JSON-serialized array describing messages to be sent, must include 2-10 items
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
:param disable_notification: Sends messages `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 messages from forwarding and saving
|
||||
:param reply_to_message_id: If the messages are a reply, ID of the original message
|
||||
|
|
@ -1086,6 +1128,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
call = SendMediaGroup(
|
||||
chat_id=chat_id,
|
||||
media=media,
|
||||
message_thread_id=message_thread_id,
|
||||
disable_notification=disable_notification,
|
||||
protect_content=protect_content,
|
||||
reply_to_message_id=reply_to_message_id,
|
||||
|
|
@ -1098,6 +1141,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
chat_id: Union[int, str],
|
||||
latitude: float,
|
||||
longitude: float,
|
||||
message_thread_id: Optional[int] = None,
|
||||
horizontal_accuracy: Optional[float] = None,
|
||||
live_period: Optional[int] = None,
|
||||
heading: Optional[int] = None,
|
||||
|
|
@ -1119,6 +1163,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 latitude: Latitude of the location
|
||||
:param longitude: Longitude of the location
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
:param horizontal_accuracy: The radius of uncertainty for the location, measured in meters; 0-1500
|
||||
:param live_period: Period in seconds for which the location will be updated (see `Live Locations <https://telegram.org/blog/live-locations>`_, should be between 60 and 86400.
|
||||
:param heading: For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
|
||||
|
|
@ -1127,7 +1172,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
: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 allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.
|
||||
:param request_timeout: Request timeout
|
||||
:return: On success, the sent Message is returned.
|
||||
"""
|
||||
|
|
@ -1135,6 +1180,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
chat_id=chat_id,
|
||||
latitude=latitude,
|
||||
longitude=longitude,
|
||||
message_thread_id=message_thread_id,
|
||||
horizontal_accuracy=horizontal_accuracy,
|
||||
live_period=live_period,
|
||||
heading=heading,
|
||||
|
|
@ -1173,7 +1219,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
: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 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/features#inline-keyboards>`_.
|
||||
:param request_timeout: Request timeout
|
||||
:return: On success, if the edited message is not an inline message, the edited Message is
|
||||
returned, otherwise True is returned.
|
||||
|
|
@ -1207,7 +1253,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
:param chat_id: Required if *inline_message_id* is not specified. Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param message_id: Required if *inline_message_id* is not specified. Identifier of the message with live location to stop
|
||||
:param inline_message_id: Required if *chat_id* and *message_id* are not specified. Identifier of the inline message
|
||||
: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/features#inline-keyboards>`_.
|
||||
:param request_timeout: Request timeout
|
||||
:return: On success, if the message is not an inline message, the edited Message is
|
||||
returned, otherwise True is returned.
|
||||
|
|
@ -1227,6 +1273,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
longitude: float,
|
||||
title: str,
|
||||
address: str,
|
||||
message_thread_id: Optional[int] = None,
|
||||
foursquare_id: Optional[str] = None,
|
||||
foursquare_type: Optional[str] = None,
|
||||
google_place_id: Optional[str] = None,
|
||||
|
|
@ -1250,6 +1297,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
:param longitude: Longitude of the venue
|
||||
:param title: Name of the venue
|
||||
:param address: Address of the venue
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
:param foursquare_id: Foursquare identifier of the venue
|
||||
:param foursquare_type: Foursquare type of the venue, if known. (For example, 'arts_entertainment/default', 'arts_entertainment/aquarium' or 'food/icecream'.)
|
||||
:param google_place_id: Google Places identifier of the venue
|
||||
|
|
@ -1258,7 +1306,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
: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 allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.
|
||||
:param request_timeout: Request timeout
|
||||
:return: On success, the sent Message is returned.
|
||||
"""
|
||||
|
|
@ -1268,6 +1316,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
longitude=longitude,
|
||||
title=title,
|
||||
address=address,
|
||||
message_thread_id=message_thread_id,
|
||||
foursquare_id=foursquare_id,
|
||||
foursquare_type=foursquare_type,
|
||||
google_place_id=google_place_id,
|
||||
|
|
@ -1285,6 +1334,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
chat_id: Union[int, str],
|
||||
phone_number: str,
|
||||
first_name: str,
|
||||
message_thread_id: Optional[int] = None,
|
||||
last_name: Optional[str] = None,
|
||||
vcard: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
|
|
@ -1304,13 +1354,14 @@ 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 phone_number: Contact's phone number
|
||||
:param first_name: Contact's first name
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
:param last_name: Contact's last name
|
||||
:param vcard: Additional data about the contact in the form of a `vCard <https://en.wikipedia.org/wiki/VCard>`_, 0-2048 bytes
|
||||
: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 reply_to_message_id: If the message is a reply, ID of the original message
|
||||
:param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove keyboard or to force a reply from the user.
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.
|
||||
:param request_timeout: Request timeout
|
||||
:return: On success, the sent Message is returned.
|
||||
"""
|
||||
|
|
@ -1318,6 +1369,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
chat_id=chat_id,
|
||||
phone_number=phone_number,
|
||||
first_name=first_name,
|
||||
message_thread_id=message_thread_id,
|
||||
last_name=last_name,
|
||||
vcard=vcard,
|
||||
disable_notification=disable_notification,
|
||||
|
|
@ -1333,6 +1385,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
chat_id: Union[int, str],
|
||||
question: str,
|
||||
options: List[str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
is_anonymous: Optional[bool] = None,
|
||||
type: Optional[str] = None,
|
||||
allows_multiple_answers: Optional[bool] = None,
|
||||
|
|
@ -1360,6 +1413,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 question: Poll question, 1-300 characters
|
||||
:param options: A JSON-serialized list of answer options, 2-10 strings 1-100 characters each
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
:param is_anonymous: :code:`True`, if the poll needs to be anonymous, defaults to :code:`True`
|
||||
:param type: Poll type, 'quiz' or 'regular', defaults to 'regular'
|
||||
:param allows_multiple_answers: :code:`True`, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to :code:`False`
|
||||
|
|
@ -1374,7 +1428,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
: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 allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.
|
||||
:param request_timeout: Request timeout
|
||||
:return: On success, the sent Message is returned.
|
||||
"""
|
||||
|
|
@ -1382,6 +1436,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
chat_id=chat_id,
|
||||
question=question,
|
||||
options=options,
|
||||
message_thread_id=message_thread_id,
|
||||
is_anonymous=is_anonymous,
|
||||
type=type,
|
||||
allows_multiple_answers=allows_multiple_answers,
|
||||
|
|
@ -1403,6 +1458,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
async def send_dice(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
emoji: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
|
|
@ -1419,17 +1475,19 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
Source: https://core.telegram.org/bots/api#senddice
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
:param emoji: Emoji on which the dice throw animation is based. Currently, must be one of '🎲', '🎯', '🏀', '⚽', '🎳', or '🎰'. Dice can have values 1-6 for '🎲', '🎯' and '🎳', values 1-5 for '🏀' and '⚽', and values 1-64 for '🎰'. Defaults to '🎲'
|
||||
: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
|
||||
:param reply_to_message_id: If the message is a reply, ID of the original message
|
||||
:param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.
|
||||
:param request_timeout: Request timeout
|
||||
:return: On success, the sent Message is returned.
|
||||
"""
|
||||
call = SendDice(
|
||||
chat_id=chat_id,
|
||||
message_thread_id=message_thread_id,
|
||||
emoji=emoji,
|
||||
disable_notification=disable_notification,
|
||||
protect_content=protect_content,
|
||||
|
|
@ -1641,6 +1699,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
can_change_info: Optional[bool] = None,
|
||||
can_invite_users: Optional[bool] = None,
|
||||
can_pin_messages: Optional[bool] = None,
|
||||
can_manage_topics: Optional[bool] = None,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> bool:
|
||||
"""
|
||||
|
|
@ -1661,6 +1720,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
:param can_change_info: Pass :code:`True` if the administrator can change chat title, photo and other settings
|
||||
:param can_invite_users: Pass :code:`True` if the administrator can invite new users to the chat
|
||||
:param can_pin_messages: Pass :code:`True` if the administrator can pin messages, supergroups only
|
||||
:param can_manage_topics: Pass :code:`True` if the user is allowed to create, rename, close, and reopen forum topics, supergroups only
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns True on success.
|
||||
"""
|
||||
|
|
@ -1678,6 +1738,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
can_change_info=can_change_info,
|
||||
can_invite_users=can_invite_users,
|
||||
can_pin_messages=can_pin_messages,
|
||||
can_manage_topics=can_manage_topics,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
|
|
@ -1977,7 +2038,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
Source: https://core.telegram.org/bots/api#setchattitle
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param title: New chat title, 1-255 characters
|
||||
:param title: New chat title, 1-128 characters
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns True on success.
|
||||
"""
|
||||
|
|
@ -2255,6 +2316,165 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
async def get_forum_topic_icon_stickers(
|
||||
self,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> List[Sticker]:
|
||||
"""
|
||||
Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user. Requires no parameters. Returns an Array of :class:`aiogram.types.sticker.Sticker` objects.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#getforumtopiciconstickers
|
||||
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns an Array of Sticker objects.
|
||||
"""
|
||||
call = GetForumTopicIconStickers()
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
async def create_forum_topic(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
name: str,
|
||||
icon_color: Optional[int] = None,
|
||||
icon_custom_emoji_id: Optional[str] = None,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> ForumTopic:
|
||||
"""
|
||||
Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights. Returns information about the created topic as a :class:`aiogram.types.forum_topic.ForumTopic` object.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#createforumtopic
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)
|
||||
:param name: Topic name, 1-128 characters
|
||||
:param icon_color: Color of the topic icon in RGB format. Currently, must be one of 0x6FB9F0, 0xFFD67E, 0xCB86DB, 0x8EEE98, 0xFF93B2, or 0xFB6F5F
|
||||
:param icon_custom_emoji_id: Unique identifier of the custom emoji shown as the topic icon. Use :class:`aiogram.methods.get_forum_topic_icon_stickers.GetForumTopicIconStickers` to get all allowed custom emoji identifiers.
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns information about the created topic as a ForumTopic object.
|
||||
"""
|
||||
call = CreateForumTopic(
|
||||
chat_id=chat_id,
|
||||
name=name,
|
||||
icon_color=icon_color,
|
||||
icon_custom_emoji_id=icon_custom_emoji_id,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
async def edit_forum_topic(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
message_thread_id: int,
|
||||
name: str,
|
||||
icon_custom_emoji_id: str,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> bool:
|
||||
"""
|
||||
Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have *can_manage_topics* administrator rights, unless it is the creator of the topic. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#editforumtopic
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)
|
||||
:param message_thread_id: Unique identifier for the target message thread of the forum topic
|
||||
:param name: New topic name, 1-128 characters
|
||||
:param icon_custom_emoji_id: New unique identifier of the custom emoji shown as the topic icon. Use :class:`aiogram.methods.get_forum_topic_icon_stickers.GetForumTopicIconStickers` to get all allowed custom emoji identifiers
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns True on success.
|
||||
"""
|
||||
call = EditForumTopic(
|
||||
chat_id=chat_id,
|
||||
message_thread_id=message_thread_id,
|
||||
name=name,
|
||||
icon_custom_emoji_id=icon_custom_emoji_id,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
async def close_forum_topic(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
message_thread_id: int,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> bool:
|
||||
"""
|
||||
Use this method to close an open topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights, unless it is the creator of the topic. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#closeforumtopic
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)
|
||||
:param message_thread_id: Unique identifier for the target message thread of the forum topic
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns True on success.
|
||||
"""
|
||||
call = CloseForumTopic(
|
||||
chat_id=chat_id,
|
||||
message_thread_id=message_thread_id,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
async def reopen_forum_topic(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
message_thread_id: int,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> bool:
|
||||
"""
|
||||
Use this method to reopen a closed topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights, unless it is the creator of the topic. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#reopenforumtopic
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)
|
||||
:param message_thread_id: Unique identifier for the target message thread of the forum topic
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns True on success.
|
||||
"""
|
||||
call = ReopenForumTopic(
|
||||
chat_id=chat_id,
|
||||
message_thread_id=message_thread_id,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
async def delete_forum_topic(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
message_thread_id: int,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> bool:
|
||||
"""
|
||||
Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_delete_messages* administrator rights. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#deleteforumtopic
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)
|
||||
:param message_thread_id: Unique identifier for the target message thread of the forum topic
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns True on success.
|
||||
"""
|
||||
call = DeleteForumTopic(
|
||||
chat_id=chat_id,
|
||||
message_thread_id=message_thread_id,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
async def unpin_all_forum_topic_messages(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
message_thread_id: int,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> bool:
|
||||
"""
|
||||
Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the *can_pin_messages* administrator right in the supergroup. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#unpinallforumtopicmessages
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)
|
||||
:param message_thread_id: Unique identifier for the target message thread of the forum topic
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns True on success.
|
||||
"""
|
||||
call = UnpinAllForumTopicMessages(
|
||||
chat_id=chat_id,
|
||||
message_thread_id=message_thread_id,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
async def answer_callback_query(
|
||||
self,
|
||||
callback_query_id: str,
|
||||
|
|
@ -2265,7 +2485,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
request_timeout: Optional[int] = None,
|
||||
) -> 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/features#inline-keyboards>`_. 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.
|
||||
|
||||
|
|
@ -2296,7 +2516,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
request_timeout: Optional[int] = None,
|
||||
) -> bool:
|
||||
"""
|
||||
Use this method to change the list of the bot's commands. See `https://core.telegram.org/bots#commands <https://core.telegram.org/bots#commands>`_`https://core.telegram.org/bots#commands <https://core.telegram.org/bots#commands>`_ for more details about bot commands. Returns :code:`True` on success.
|
||||
Use this method to change the list of the bot's commands. See `this manual <https://core.telegram.org/bots/features#commands>`_ for more details about bot commands. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setmycommands
|
||||
|
||||
|
|
@ -2361,7 +2581,9 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
async def set_chat_menu_button(
|
||||
self,
|
||||
chat_id: Optional[int] = None,
|
||||
menu_button: Optional[MenuButton] = None,
|
||||
menu_button: Optional[
|
||||
Union[MenuButtonDefault, MenuButtonWebApp, MenuButtonCommands]
|
||||
] = None,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> bool:
|
||||
"""
|
||||
|
|
@ -2384,7 +2606,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
self,
|
||||
chat_id: Optional[int] = None,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> MenuButton:
|
||||
) -> Union[MenuButtonDefault, MenuButtonWebApp, MenuButtonCommands]:
|
||||
"""
|
||||
Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns :class:`aiogram.types.menu_button.MenuButton` on success.
|
||||
|
||||
|
|
@ -2469,7 +2691,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
:param parse_mode: Mode for parsing entities in the message text. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
||||
:param entities: A JSON-serialized list of special entities that appear in message text, which can be specified instead of *parse_mode*
|
||||
:param disable_web_page_preview: Disables link previews for links in this message
|
||||
:param reply_markup: A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_.
|
||||
:param reply_markup: A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_.
|
||||
:param request_timeout: Request timeout
|
||||
:return: On success, if the edited message is not an inline message, the edited Message is
|
||||
returned, otherwise True is returned.
|
||||
|
|
@ -2508,7 +2730,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
:param caption: New caption of the message, 0-1024 characters after entities parsing
|
||||
:param parse_mode: Mode for parsing entities in the 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 reply_markup: A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_.
|
||||
:param reply_markup: A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_.
|
||||
:param request_timeout: Request timeout
|
||||
:return: On success, if the edited message is not an inline message, the edited Message is
|
||||
returned, otherwise True is returned.
|
||||
|
|
@ -2542,7 +2764,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
:param chat_id: Required if *inline_message_id* is not specified. Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param message_id: Required if *inline_message_id* is not specified. Identifier of the message to edit
|
||||
:param inline_message_id: Required if *chat_id* and *message_id* are not specified. Identifier of the inline message
|
||||
: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/features#inline-keyboards>`_.
|
||||
:param request_timeout: Request timeout
|
||||
:return: On success, if the edited message is not an inline message, the edited Message is
|
||||
returned, otherwise True is returned.
|
||||
|
|
@ -2572,7 +2794,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
:param chat_id: Required if *inline_message_id* is not specified. Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param message_id: Required if *inline_message_id* is not specified. Identifier of the message to edit
|
||||
:param inline_message_id: Required if *chat_id* and *message_id* are not specified. Identifier of the inline message
|
||||
:param reply_markup: A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_.
|
||||
:param reply_markup: A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_.
|
||||
:param request_timeout: Request timeout
|
||||
:return: On success, if the edited message is not an inline message, the edited Message is
|
||||
returned, otherwise True is returned.
|
||||
|
|
@ -2599,7 +2821,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 message_id: Identifier of the original message with the poll
|
||||
:param reply_markup: A JSON-serialized object for a new message `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_.
|
||||
:param reply_markup: A JSON-serialized object for a new message `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_.
|
||||
:param request_timeout: Request timeout
|
||||
:return: On success, the stopped Poll is returned.
|
||||
"""
|
||||
|
|
@ -2621,6 +2843,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
|
||||
- A message can only be deleted if it was sent less than 48 hours ago.
|
||||
|
||||
- Service messages about a supergroup, channel, or forum topic creation can't be deleted.
|
||||
|
||||
- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.
|
||||
|
||||
- Bots can delete outgoing messages in private chats, groups, and supergroups.
|
||||
|
|
@ -2657,6 +2881,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
self,
|
||||
chat_id: Union[int, str],
|
||||
sticker: Union[InputFile, str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
|
|
@ -2673,17 +2898,19 @@ 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 sticker: Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
: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 reply_to_message_id: If the message is a reply, ID of the original message
|
||||
:param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.
|
||||
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.
|
||||
:param request_timeout: Request timeout
|
||||
:return: On success, the sent Message is returned.
|
||||
"""
|
||||
call = SendSticker(
|
||||
chat_id=chat_id,
|
||||
sticker=sticker,
|
||||
message_thread_id=message_thread_id,
|
||||
disable_notification=disable_notification,
|
||||
protect_content=protect_content,
|
||||
reply_to_message_id=reply_to_message_id,
|
||||
|
|
@ -2927,7 +3154,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
:param is_personal: Pass :code:`True` if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query
|
||||
:param next_offset: Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don't support pagination. Offset length can't exceed 64 bytes.
|
||||
:param switch_pm_text: If passed, clients will display a button with specified text that switches the user to a private chat with the bot and sends the bot a start message with the parameter *switch_pm_parameter*
|
||||
:param switch_pm_parameter: `Deep-linking <https://core.telegram.org/bots#deep-linking>`_ parameter for the /start message sent to the bot when user presses the switch button. 1-64 characters, only :code:`A-Z`, :code:`a-z`, :code:`0-9`, :code:`_` and :code:`-` are allowed.
|
||||
:param switch_pm_parameter: `Deep-linking <https://core.telegram.org/bots/features#deep-linking>`_ parameter for the /start message sent to the bot when user presses the switch button. 1-64 characters, only :code:`A-Z`, :code:`a-z`, :code:`0-9`, :code:`_` and :code:`-` are allowed.
|
||||
:param request_timeout: Request timeout
|
||||
:return: On success, True is returned.
|
||||
"""
|
||||
|
|
@ -2978,6 +3205,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
provider_token: str,
|
||||
currency: str,
|
||||
prices: List[LabeledPrice],
|
||||
message_thread_id: Optional[int] = None,
|
||||
max_tip_amount: Optional[int] = None,
|
||||
suggested_tip_amounts: Optional[List[int]] = None,
|
||||
start_parameter: Optional[str] = None,
|
||||
|
|
@ -3012,6 +3240,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
: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 message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
: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 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
|
||||
|
|
@ -3031,7 +3260,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
: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 allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
|
||||
:param reply_markup: A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_. If empty, one 'Pay :code:`total price`' button will be shown. If not empty, the first button must be a Pay button.
|
||||
:param reply_markup: A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_. If empty, one 'Pay :code:`total price`' button will be shown. If not empty, the first button must be a Pay button.
|
||||
:param request_timeout: Request timeout
|
||||
:return: On success, the sent Message is returned.
|
||||
"""
|
||||
|
|
@ -3043,6 +3272,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
provider_token=provider_token,
|
||||
currency=currency,
|
||||
prices=prices,
|
||||
message_thread_id=message_thread_id,
|
||||
max_tip_amount=max_tip_amount,
|
||||
suggested_tip_amounts=suggested_tip_amounts,
|
||||
start_parameter=start_parameter,
|
||||
|
|
@ -3234,6 +3464,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
self,
|
||||
chat_id: int,
|
||||
game_short_name: str,
|
||||
message_thread_id: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
|
|
@ -3248,17 +3479,19 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
|
||||
:param chat_id: Unique identifier for the target chat
|
||||
:param game_short_name: Short name of the game, serves as the unique identifier for the game. Set up your games via `@BotFather <https://t.me/botfather>`_.
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
: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 reply_to_message_id: If the message is a reply, ID of the original message
|
||||
:param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
|
||||
:param reply_markup: A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game.
|
||||
:param reply_markup: A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game.
|
||||
:param request_timeout: Request timeout
|
||||
:return: On success, the sent Message is returned.
|
||||
"""
|
||||
call = SendGame(
|
||||
chat_id=chat_id,
|
||||
game_short_name=game_short_name,
|
||||
message_thread_id=message_thread_id,
|
||||
disable_notification=disable_notification,
|
||||
protect_content=protect_content,
|
||||
reply_to_message_id=reply_to_message_id,
|
||||
|
|
|
|||
|
|
@ -9,18 +9,22 @@ from .ban_chat_member import BanChatMember
|
|||
from .ban_chat_sender_chat import BanChatSenderChat
|
||||
from .base import Request, Response, TelegramMethod
|
||||
from .close import Close
|
||||
from .close_forum_topic import CloseForumTopic
|
||||
from .copy_message import CopyMessage
|
||||
from .create_chat_invite_link import CreateChatInviteLink
|
||||
from .create_forum_topic import CreateForumTopic
|
||||
from .create_invoice_link import CreateInvoiceLink
|
||||
from .create_new_sticker_set import CreateNewStickerSet
|
||||
from .decline_chat_join_request import DeclineChatJoinRequest
|
||||
from .delete_chat_photo import DeleteChatPhoto
|
||||
from .delete_chat_sticker_set import DeleteChatStickerSet
|
||||
from .delete_forum_topic import DeleteForumTopic
|
||||
from .delete_message import DeleteMessage
|
||||
from .delete_my_commands import DeleteMyCommands
|
||||
from .delete_sticker_from_set import DeleteStickerFromSet
|
||||
from .delete_webhook import DeleteWebhook
|
||||
from .edit_chat_invite_link import EditChatInviteLink
|
||||
from .edit_forum_topic import EditForumTopic
|
||||
from .edit_message_caption import EditMessageCaption
|
||||
from .edit_message_live_location import EditMessageLiveLocation
|
||||
from .edit_message_media import EditMessageMedia
|
||||
|
|
@ -36,6 +40,7 @@ from .get_chat_members_count import GetChatMembersCount
|
|||
from .get_chat_menu_button import GetChatMenuButton
|
||||
from .get_custom_emoji_stickers import GetCustomEmojiStickers
|
||||
from .get_file import GetFile
|
||||
from .get_forum_topic_icon_stickers import GetForumTopicIconStickers
|
||||
from .get_game_high_scores import GetGameHighScores
|
||||
from .get_me import GetMe
|
||||
from .get_my_commands import GetMyCommands
|
||||
|
|
@ -49,6 +54,7 @@ from .leave_chat import LeaveChat
|
|||
from .log_out import LogOut
|
||||
from .pin_chat_message import PinChatMessage
|
||||
from .promote_chat_member import PromoteChatMember
|
||||
from .reopen_forum_topic import ReopenForumTopic
|
||||
from .restrict_chat_member import RestrictChatMember
|
||||
from .revoke_chat_invite_link import RevokeChatInviteLink
|
||||
from .send_animation import SendAnimation
|
||||
|
|
@ -88,6 +94,7 @@ from .stop_poll import StopPoll
|
|||
from .unban_chat_member import UnbanChatMember
|
||||
from .unban_chat_sender_chat import UnbanChatSenderChat
|
||||
from .unpin_all_chat_messages import UnpinAllChatMessages
|
||||
from .unpin_all_forum_topic_messages import UnpinAllForumTopicMessages
|
||||
from .unpin_chat_message import UnpinChatMessage
|
||||
from .upload_sticker_file import UploadStickerFile
|
||||
|
||||
|
|
@ -153,6 +160,13 @@ __all__ = (
|
|||
"GetChatMember",
|
||||
"SetChatStickerSet",
|
||||
"DeleteChatStickerSet",
|
||||
"GetForumTopicIconStickers",
|
||||
"CreateForumTopic",
|
||||
"EditForumTopic",
|
||||
"CloseForumTopic",
|
||||
"ReopenForumTopic",
|
||||
"DeleteForumTopic",
|
||||
"UnpinAllForumTopicMessages",
|
||||
"AnswerCallbackQuery",
|
||||
"SetMyCommands",
|
||||
"DeleteMyCommands",
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ if TYPE_CHECKING:
|
|||
|
||||
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/features#inline-keyboards>`_. 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.
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class AnswerInlineQuery(TelegramMethod[bool]):
|
|||
switch_pm_text: Optional[str] = None
|
||||
"""If passed, clients will display a button with specified text that switches the user to a private chat with the bot and sends the bot a start message with the parameter *switch_pm_parameter*"""
|
||||
switch_pm_parameter: Optional[str] = None
|
||||
"""`Deep-linking <https://core.telegram.org/bots#deep-linking>`_ parameter for the /start message sent to the bot when user presses the switch button. 1-64 characters, only :code:`A-Z`, :code:`a-z`, :code:`0-9`, :code:`_` and :code:`-` are allowed."""
|
||||
"""`Deep-linking <https://core.telegram.org/bots/features#deep-linking>`_ parameter for the /start message sent to the bot when user presses the switch button. 1-64 characters, only :code:`A-Z`, :code:`a-z`, :code:`0-9`, :code:`_` and :code:`-` are allowed."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
|
|
|||
28
aiogram/methods/close_forum_topic.py
Normal file
28
aiogram/methods/close_forum_topic.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Dict, Union
|
||||
|
||||
from .base import Request, TelegramMethod
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..client.bot import Bot
|
||||
|
||||
|
||||
class CloseForumTopic(TelegramMethod[bool]):
|
||||
"""
|
||||
Use this method to close an open topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights, unless it is the creator of the topic. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#closeforumtopic
|
||||
"""
|
||||
|
||||
__returning__ = bool
|
||||
|
||||
chat_id: Union[int, str]
|
||||
"""Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)"""
|
||||
message_thread_id: int
|
||||
"""Unique identifier for the target message thread of the forum topic"""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
||||
return Request(method="closeForumTopic", data=data)
|
||||
|
|
@ -32,6 +32,8 @@ class CopyMessage(TelegramMethod[MessageId]):
|
|||
"""Unique identifier for the chat where the original message was sent (or channel username in the format :code:`@channelusername`)"""
|
||||
message_id: int
|
||||
"""Message identifier in the chat specified in *from_chat_id*"""
|
||||
message_thread_id: Optional[int] = None
|
||||
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
|
||||
caption: Optional[str] = None
|
||||
"""New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
|
|
@ -49,7 +51,7 @@ class CopyMessage(TelegramMethod[MessageId]):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user."""
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
|
|
|||
33
aiogram/methods/create_forum_topic.py
Normal file
33
aiogram/methods/create_forum_topic.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Dict, Optional, Union
|
||||
|
||||
from ..types import ForumTopic
|
||||
from .base import Request, TelegramMethod
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..client.bot import Bot
|
||||
|
||||
|
||||
class CreateForumTopic(TelegramMethod[ForumTopic]):
|
||||
"""
|
||||
Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights. Returns information about the created topic as a :class:`aiogram.types.forum_topic.ForumTopic` object.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#createforumtopic
|
||||
"""
|
||||
|
||||
__returning__ = ForumTopic
|
||||
|
||||
chat_id: Union[int, str]
|
||||
"""Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)"""
|
||||
name: str
|
||||
"""Topic name, 1-128 characters"""
|
||||
icon_color: Optional[int] = None
|
||||
"""Color of the topic icon in RGB format. Currently, must be one of 0x6FB9F0, 0xFFD67E, 0xCB86DB, 0x8EEE98, 0xFF93B2, or 0xFB6F5F"""
|
||||
icon_custom_emoji_id: Optional[str] = None
|
||||
"""Unique identifier of the custom emoji shown as the topic icon. Use :class:`aiogram.methods.get_forum_topic_icon_stickers.GetForumTopicIconStickers` to get all allowed custom emoji identifiers."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
||||
return Request(method="createForumTopic", data=data)
|
||||
28
aiogram/methods/delete_forum_topic.py
Normal file
28
aiogram/methods/delete_forum_topic.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Dict, Union
|
||||
|
||||
from .base import Request, TelegramMethod
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..client.bot import Bot
|
||||
|
||||
|
||||
class DeleteForumTopic(TelegramMethod[bool]):
|
||||
"""
|
||||
Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_delete_messages* administrator rights. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#deleteforumtopic
|
||||
"""
|
||||
|
||||
__returning__ = bool
|
||||
|
||||
chat_id: Union[int, str]
|
||||
"""Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)"""
|
||||
message_thread_id: int
|
||||
"""Unique identifier for the target message thread of the forum topic"""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
||||
return Request(method="deleteForumTopic", data=data)
|
||||
|
|
@ -14,6 +14,8 @@ class DeleteMessage(TelegramMethod[bool]):
|
|||
|
||||
- A message can only be deleted if it was sent less than 48 hours ago.
|
||||
|
||||
- Service messages about a supergroup, channel, or forum topic creation can't be deleted.
|
||||
|
||||
- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.
|
||||
|
||||
- Bots can delete outgoing messages in private chats, groups, and supergroups.
|
||||
|
|
|
|||
32
aiogram/methods/edit_forum_topic.py
Normal file
32
aiogram/methods/edit_forum_topic.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Dict, Union
|
||||
|
||||
from .base import Request, TelegramMethod
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..client.bot import Bot
|
||||
|
||||
|
||||
class EditForumTopic(TelegramMethod[bool]):
|
||||
"""
|
||||
Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have *can_manage_topics* administrator rights, unless it is the creator of the topic. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#editforumtopic
|
||||
"""
|
||||
|
||||
__returning__ = bool
|
||||
|
||||
chat_id: Union[int, str]
|
||||
"""Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)"""
|
||||
message_thread_id: int
|
||||
"""Unique identifier for the target message thread of the forum topic"""
|
||||
name: str
|
||||
"""New topic name, 1-128 characters"""
|
||||
icon_custom_emoji_id: str
|
||||
"""New unique identifier of the custom emoji shown as the topic icon. Use :class:`aiogram.methods.get_forum_topic_icon_stickers.GetForumTopicIconStickers` to get all allowed custom emoji identifiers"""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
||||
return Request(method="editForumTopic", data=data)
|
||||
|
|
@ -31,7 +31,7 @@ class EditMessageCaption(TelegramMethod[Union[Message, bool]]):
|
|||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_."""
|
||||
"""A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class EditMessageLiveLocation(TelegramMethod[Union[Message, bool]]):
|
|||
proximity_alert_radius: Optional[int] = None
|
||||
"""The maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified."""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""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/features#inline-keyboards>`_."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class EditMessageMedia(TelegramMethod[Union[Message, bool]]):
|
|||
inline_message_id: Optional[str] = None
|
||||
"""Required if *chat_id* and *message_id* are not specified. Identifier of the inline message"""
|
||||
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/features#inline-keyboards>`_."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class EditMessageReplyMarkup(TelegramMethod[Union[Message, bool]]):
|
|||
inline_message_id: Optional[str] = None
|
||||
"""Required if *chat_id* and *message_id* are not specified. Identifier of the inline message"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_."""
|
||||
"""A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class EditMessageText(TelegramMethod[Union[Message, bool]]):
|
|||
disable_web_page_preview: Optional[bool] = None
|
||||
"""Disables link previews for links in this message"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_."""
|
||||
"""A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ class ForwardMessage(TelegramMethod[Message]):
|
|||
"""Unique identifier for the chat where the original message was sent (or channel username in the format :code:`@channelusername`)"""
|
||||
message_id: int
|
||||
"""Message identifier in the chat specified in *from_chat_id*"""
|
||||
message_thread_id: Optional[int] = None
|
||||
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
|
||||
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."""
|
||||
protect_content: Optional[bool] = None
|
||||
|
|
|
|||
|
|
@ -2,14 +2,16 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, Any, Dict, Optional, Union
|
||||
|
||||
from ..types import MenuButton, MenuButtonCommands, MenuButtonDefault, MenuButtonWebApp
|
||||
from ..types import MenuButtonCommands, MenuButtonDefault, MenuButtonWebApp
|
||||
from .base import Request, TelegramMethod
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..client.bot import Bot
|
||||
|
||||
|
||||
class GetChatMenuButton(TelegramMethod[MenuButton]):
|
||||
class GetChatMenuButton(
|
||||
TelegramMethod[Union[MenuButtonDefault, MenuButtonWebApp, MenuButtonCommands]]
|
||||
):
|
||||
"""
|
||||
Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns :class:`aiogram.types.menu_button.MenuButton` on success.
|
||||
|
||||
|
|
|
|||
24
aiogram/methods/get_forum_topic_icon_stickers.py
Normal file
24
aiogram/methods/get_forum_topic_icon_stickers.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Dict, List
|
||||
|
||||
from ..types import Sticker
|
||||
from .base import Request, TelegramMethod
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..client.bot import Bot
|
||||
|
||||
|
||||
class GetForumTopicIconStickers(TelegramMethod[List[Sticker]]):
|
||||
"""
|
||||
Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user. Requires no parameters. Returns an Array of :class:`aiogram.types.sticker.Sticker` objects.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#getforumtopiciconstickers
|
||||
"""
|
||||
|
||||
__returning__ = List[Sticker]
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
||||
return Request(method="getForumTopicIconStickers", data=data)
|
||||
|
|
@ -43,6 +43,8 @@ class PromoteChatMember(TelegramMethod[bool]):
|
|||
"""Pass :code:`True` if the administrator can invite new users to the chat"""
|
||||
can_pin_messages: Optional[bool] = None
|
||||
"""Pass :code:`True` if the administrator can pin messages, supergroups only"""
|
||||
can_manage_topics: Optional[bool] = None
|
||||
"""Pass :code:`True` if the user is allowed to create, rename, close, and reopen forum topics, supergroups only"""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
|
|
|||
28
aiogram/methods/reopen_forum_topic.py
Normal file
28
aiogram/methods/reopen_forum_topic.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Dict, Union
|
||||
|
||||
from .base import Request, TelegramMethod
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..client.bot import Bot
|
||||
|
||||
|
||||
class ReopenForumTopic(TelegramMethod[bool]):
|
||||
"""
|
||||
Use this method to reopen a closed topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights, unless it is the creator of the topic. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#reopenforumtopic
|
||||
"""
|
||||
|
||||
__returning__ = bool
|
||||
|
||||
chat_id: Union[int, str]
|
||||
"""Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)"""
|
||||
message_thread_id: int
|
||||
"""Unique identifier for the target message thread of the forum topic"""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
||||
return Request(method="reopenForumTopic", data=data)
|
||||
|
|
@ -31,6 +31,8 @@ class SendAnimation(TelegramMethod[Message]):
|
|||
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
||||
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 information on Sending Files » <sending-files>`"""
|
||||
message_thread_id: Optional[int] = None
|
||||
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
|
||||
duration: Optional[int] = None
|
||||
"""Duration of sent animation in seconds"""
|
||||
width: Optional[int] = None
|
||||
|
|
@ -56,7 +58,7 @@ class SendAnimation(TelegramMethod[Message]):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user."""
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict(exclude={"animation", "thumb"})
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ class SendAudio(TelegramMethod[Message]):
|
|||
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
||||
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 information on Sending Files » <sending-files>`"""
|
||||
message_thread_id: Optional[int] = None
|
||||
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
|
||||
caption: Optional[str] = None
|
||||
"""Audio caption, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
|
|
@ -57,7 +59,7 @@ class SendAudio(TelegramMethod[Message]):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user."""
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict(exclude={"audio", "thumb"})
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ class SendContact(TelegramMethod[Message]):
|
|||
"""Contact's phone number"""
|
||||
first_name: str
|
||||
"""Contact's first name"""
|
||||
message_thread_id: Optional[int] = None
|
||||
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
|
||||
last_name: Optional[str] = None
|
||||
"""Contact's last name"""
|
||||
vcard: Optional[str] = None
|
||||
|
|
@ -45,7 +47,7 @@ class SendContact(TelegramMethod[Message]):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove keyboard or to force a reply from the user."""
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ class SendDice(TelegramMethod[Message]):
|
|||
|
||||
chat_id: Union[int, str]
|
||||
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
||||
message_thread_id: Optional[int] = None
|
||||
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
|
||||
emoji: Optional[str] = None
|
||||
"""Emoji on which the dice throw animation is based. Currently, must be one of '🎲', '🎯', '🏀', '⚽', '🎳', or '🎰'. Dice can have values 1-6 for '🎲', '🎯' and '🎳', values 1-5 for '🏀' and '⚽', and values 1-64 for '🎰'. Defaults to '🎲'"""
|
||||
disable_notification: Optional[bool] = None
|
||||
|
|
@ -39,7 +41,7 @@ class SendDice(TelegramMethod[Message]):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user."""
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ class SendDocument(TelegramMethod[Message]):
|
|||
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
||||
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 information on Sending Files » <sending-files>`"""
|
||||
message_thread_id: Optional[int] = None
|
||||
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
|
||||
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 information on Sending Files » <sending-files>`"""
|
||||
caption: Optional[str] = None
|
||||
|
|
@ -52,7 +54,7 @@ class SendDocument(TelegramMethod[Message]):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user."""
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict(exclude={"document", "thumb"})
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ class SendGame(TelegramMethod[Message]):
|
|||
"""Unique identifier for the target chat"""
|
||||
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>`_."""
|
||||
message_thread_id: Optional[int] = None
|
||||
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
|
||||
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."""
|
||||
protect_content: Optional[bool] = None
|
||||
|
|
@ -31,7 +33,7 @@ class SendGame(TelegramMethod[Message]):
|
|||
allow_sending_without_reply: Optional[bool] = None
|
||||
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game."""
|
||||
"""A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ class SendInvoice(TelegramMethod[Message]):
|
|||
"""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.)"""
|
||||
message_thread_id: Optional[int] = None
|
||||
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
|
||||
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
|
||||
|
|
@ -71,7 +73,7 @@ class SendInvoice(TelegramMethod[Message]):
|
|||
allow_sending_without_reply: Optional[bool] = None
|
||||
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_. If empty, one 'Pay :code:`total price`' button will be shown. If not empty, the first button must be a Pay button."""
|
||||
"""A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_. If empty, one 'Pay :code:`total price`' button will be shown. If not empty, the first button must be a Pay button."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ class SendLocation(TelegramMethod[Message]):
|
|||
"""Latitude of the location"""
|
||||
longitude: float
|
||||
"""Longitude of the location"""
|
||||
message_thread_id: Optional[int] = None
|
||||
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
|
||||
horizontal_accuracy: Optional[float] = None
|
||||
"""The radius of uncertainty for the location, measured in meters; 0-1500"""
|
||||
live_period: Optional[int] = None
|
||||
|
|
@ -49,7 +51,7 @@ class SendLocation(TelegramMethod[Message]):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user."""
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ class SendMediaGroup(TelegramMethod[List[Message]]):
|
|||
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
||||
media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]]
|
||||
"""A JSON-serialized array describing messages to be sent, must include 2-10 items"""
|
||||
message_thread_id: Optional[int] = None
|
||||
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
|
||||
disable_notification: Optional[bool] = None
|
||||
"""Sends messages `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
||||
protect_content: Optional[bool] = None
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ class SendMessage(TelegramMethod[Message]):
|
|||
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
||||
text: str
|
||||
"""Text of the message to be sent, 1-4096 characters after entities parsing"""
|
||||
message_thread_id: Optional[int] = None
|
||||
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Mode for parsing entities in the message text. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
entities: Optional[List[MessageEntity]] = None
|
||||
|
|
@ -47,7 +49,7 @@ class SendMessage(TelegramMethod[Message]):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user."""
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ class SendPhoto(TelegramMethod[Message]):
|
|||
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
||||
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 information on Sending Files » <sending-files>`"""
|
||||
message_thread_id: Optional[int] = None
|
||||
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
|
||||
caption: Optional[str] = None
|
||||
"""Photo caption (may also be used when resending photos by *file_id*), 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
|
|
@ -48,7 +50,7 @@ class SendPhoto(TelegramMethod[Message]):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user."""
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict(exclude={"photo"})
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@ class SendPoll(TelegramMethod[Message]):
|
|||
"""Poll question, 1-300 characters"""
|
||||
options: List[str]
|
||||
"""A JSON-serialized list of answer options, 2-10 strings 1-100 characters each"""
|
||||
message_thread_id: Optional[int] = None
|
||||
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
|
||||
is_anonymous: Optional[bool] = None
|
||||
""":code:`True`, if the poll needs to be anonymous, defaults to :code:`True`"""
|
||||
type: Optional[str] = None
|
||||
|
|
@ -64,7 +66,7 @@ class SendPoll(TelegramMethod[Message]):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user."""
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ class SendSticker(TelegramMethod[Message]):
|
|||
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
||||
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 information on Sending Files » <sending-files>`"""
|
||||
message_thread_id: Optional[int] = None
|
||||
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
|
||||
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."""
|
||||
protect_content: Optional[bool] = None
|
||||
|
|
@ -40,7 +42,7 @@ class SendSticker(TelegramMethod[Message]):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user."""
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict(exclude={"sticker"})
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ class SendVenue(TelegramMethod[Message]):
|
|||
"""Name of the venue"""
|
||||
address: str
|
||||
"""Address of the venue"""
|
||||
message_thread_id: Optional[int] = None
|
||||
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
|
||||
foursquare_id: Optional[str] = None
|
||||
"""Foursquare identifier of the venue"""
|
||||
foursquare_type: Optional[str] = None
|
||||
|
|
@ -53,7 +55,7 @@ class SendVenue(TelegramMethod[Message]):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user."""
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ class SendVideo(TelegramMethod[Message]):
|
|||
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
||||
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 information on Sending Files » <sending-files>`"""
|
||||
message_thread_id: Optional[int] = None
|
||||
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
|
||||
duration: Optional[int] = None
|
||||
"""Duration of sent video in seconds"""
|
||||
width: Optional[int] = None
|
||||
|
|
@ -58,7 +60,7 @@ class SendVideo(TelegramMethod[Message]):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user."""
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict(exclude={"video", "thumb"})
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ class SendVideoNote(TelegramMethod[Message]):
|
|||
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
||||
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 information on Sending Files » <sending-files>`. Sending video notes by a URL is currently unsupported"""
|
||||
message_thread_id: Optional[int] = None
|
||||
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
|
||||
duration: Optional[int] = None
|
||||
"""Duration of sent video in seconds"""
|
||||
length: Optional[int] = None
|
||||
|
|
@ -46,7 +48,7 @@ class SendVideoNote(TelegramMethod[Message]):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user."""
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict(exclude={"video_note", "thumb"})
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ class SendVoice(TelegramMethod[Message]):
|
|||
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
||||
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 information on Sending Files » <sending-files>`"""
|
||||
message_thread_id: Optional[int] = None
|
||||
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
|
||||
caption: Optional[str] = None
|
||||
"""Voice message caption, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
|
|
@ -50,7 +52,7 @@ class SendVoice(TelegramMethod[Message]):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_, `custom reply keyboard <https://core.telegram.org/bots#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user."""
|
||||
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict(exclude={"voice"})
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Dict, Optional
|
||||
from typing import TYPE_CHECKING, Any, Dict, Optional, Union
|
||||
|
||||
from ..types import MenuButton
|
||||
from ..types import MenuButtonCommands, MenuButtonDefault, MenuButtonWebApp
|
||||
from .base import Request, TelegramMethod
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -20,7 +20,7 @@ class SetChatMenuButton(TelegramMethod[bool]):
|
|||
|
||||
chat_id: Optional[int] = None
|
||||
"""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[Union[MenuButtonDefault, MenuButtonWebApp, MenuButtonCommands]] = None
|
||||
"""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:
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class SetChatTitle(TelegramMethod[bool]):
|
|||
chat_id: Union[int, str]
|
||||
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
||||
title: str
|
||||
"""New chat title, 1-255 characters"""
|
||||
"""New chat title, 1-128 characters"""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ if TYPE_CHECKING:
|
|||
|
||||
class SetMyCommands(TelegramMethod[bool]):
|
||||
"""
|
||||
Use this method to change the list of the bot's commands. See `https://core.telegram.org/bots#commands <https://core.telegram.org/bots#commands>`_`https://core.telegram.org/bots#commands <https://core.telegram.org/bots#commands>`_ for more details about bot commands. Returns :code:`True` on success.
|
||||
Use this method to change the list of the bot's commands. See `this manual <https://core.telegram.org/bots/features#commands>`_ for more details about bot commands. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setmycommands
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class StopMessageLiveLocation(TelegramMethod[Union[Message, bool]]):
|
|||
inline_message_id: Optional[str] = None
|
||||
"""Required if *chat_id* and *message_id* are not specified. Identifier of the inline message"""
|
||||
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/features#inline-keyboards>`_."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class StopPoll(TelegramMethod[Poll]):
|
|||
message_id: int
|
||||
"""Identifier of the original message with the poll"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""A JSON-serialized object for a new message `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_."""
|
||||
"""A JSON-serialized object for a new message `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
|
|
|||
28
aiogram/methods/unpin_all_forum_topic_messages.py
Normal file
28
aiogram/methods/unpin_all_forum_topic_messages.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Dict, Union
|
||||
|
||||
from .base import Request, TelegramMethod
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..client.bot import Bot
|
||||
|
||||
|
||||
class UnpinAllForumTopicMessages(TelegramMethod[bool]):
|
||||
"""
|
||||
Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the *can_pin_messages* administrator right in the supergroup. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#unpinallforumtopicmessages
|
||||
"""
|
||||
|
||||
__returning__ = bool
|
||||
|
||||
chat_id: Union[int, str]
|
||||
"""Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)"""
|
||||
message_thread_id: int
|
||||
"""Unique identifier for the target message thread of the forum topic"""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
||||
return Request(method="unpinAllForumTopicMessages", data=data)
|
||||
|
|
@ -39,6 +39,10 @@ from .encrypted_credentials import EncryptedCredentials
|
|||
from .encrypted_passport_element import EncryptedPassportElement
|
||||
from .file import File
|
||||
from .force_reply import ForceReply
|
||||
from .forum_topic import ForumTopic
|
||||
from .forum_topic_closed import ForumTopicClosed
|
||||
from .forum_topic_created import ForumTopicCreated
|
||||
from .forum_topic_reopened import ForumTopicReopened
|
||||
from .game import Game
|
||||
from .game_high_score import GameHighScore
|
||||
from .inline_keyboard_button import InlineKeyboardButton
|
||||
|
|
@ -169,6 +173,9 @@ __all__ = (
|
|||
"WebAppData",
|
||||
"ProximityAlertTriggered",
|
||||
"MessageAutoDeleteTimerChanged",
|
||||
"ForumTopicCreated",
|
||||
"ForumTopicClosed",
|
||||
"ForumTopicReopened",
|
||||
"VideoChatScheduled",
|
||||
"VideoChatStarted",
|
||||
"VideoChatEnded",
|
||||
|
|
@ -199,6 +206,7 @@ __all__ = (
|
|||
"ChatJoinRequest",
|
||||
"ChatPermissions",
|
||||
"ChatLocation",
|
||||
"ForumTopic",
|
||||
"BotCommand",
|
||||
"BotCommandScope",
|
||||
"BotCommandScopeDefault",
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ if TYPE_CHECKING:
|
|||
|
||||
class CallbackQuery(TelegramObject):
|
||||
"""
|
||||
This object represents an incoming callback query from a callback button in an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_. If the button that originated the query was attached to a message sent by the bot, the field *message* will be present. If the button was attached to a message sent via the bot (in `inline mode <https://core.telegram.org/bots/api#inline-mode>`_), the field *inline_message_id* will be present. Exactly one of the fields *data* or *game_short_name* will be present.
|
||||
This object represents an incoming callback query from a callback button in an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_. If the button that originated the query was attached to a message sent by the bot, the field *message* will be present. If the button was attached to a message sent via the bot (in `inline mode <https://core.telegram.org/bots/api#inline-mode>`_), the field *inline_message_id* will be present. Exactly one of the fields *data* or *game_short_name* will be present.
|
||||
|
||||
**NOTE:** After the user presses a callback button, Telegram clients will display a progress bar until you call :class:`aiogram.methods.answer_callback_query.AnswerCallbackQuery`. It is, therefore, necessary to react by calling :class:`aiogram.methods.answer_callback_query.AnswerCallbackQuery` even if no notification to the user is needed (e.g., without specifying any of the optional parameters).
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
from typing import TYPE_CHECKING, List, Optional
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
|
@ -31,8 +31,14 @@ class Chat(TelegramObject):
|
|||
"""*Optional*. First name of the other party in a private chat"""
|
||||
last_name: Optional[str] = None
|
||||
"""*Optional*. Last name of the other party in a private chat"""
|
||||
is_forum: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the supergroup chat is a forum (has `topics <https://telegram.org/blog/topics-in-groups-collectible-usernames#topics-in-groups>`_ enabled)"""
|
||||
photo: Optional[ChatPhoto] = None
|
||||
"""*Optional*. Chat photo. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
|
||||
active_usernames: Optional[List[str]] = None
|
||||
"""*Optional*. If non-empty, the list of all `active chat usernames <https://telegram.org/blog/topics-in-groups-collectible-usernames#collectible-usernames>`_; for private chats, supergroups and channels. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
|
||||
emoji_status_custom_emoji_id: Optional[str] = None
|
||||
"""*Optional*. Custom emoji identifier of emoji status of the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
|
||||
bio: Optional[str] = None
|
||||
"""*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
|
||||
|
|
|
|||
|
|
@ -37,3 +37,5 @@ class ChatAdministratorRights(TelegramObject):
|
|||
"""*Optional*. :code:`True`, if the administrator can edit messages of other users and can pin messages; channels only"""
|
||||
can_pin_messages: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to pin messages; groups and supergroups only"""
|
||||
can_manage_topics: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only"""
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@ class ChatMember(TelegramObject):
|
|||
"""*Optional*. :code:`True`, if the administrator can edit messages of other users and can pin messages; channels only"""
|
||||
can_pin_messages: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to pin messages; groups and supergroups only"""
|
||||
can_manage_topics: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only"""
|
||||
is_member: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is a member of the chat at the moment of the request"""
|
||||
can_send_messages: Optional[bool] = None
|
||||
|
|
|
|||
|
|
@ -45,5 +45,7 @@ class ChatMemberAdministrator(ChatMember):
|
|||
"""*Optional*. :code:`True`, if the administrator can edit messages of other users and can pin messages; channels only"""
|
||||
can_pin_messages: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to pin messages; groups and supergroups only"""
|
||||
can_manage_topics: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only"""
|
||||
custom_title: Optional[str] = None
|
||||
"""*Optional*. Custom title for this user"""
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ class ChatMemberRestricted(ChatMember):
|
|||
""":code:`True`, if the user is allowed to invite new users to the chat"""
|
||||
can_pin_messages: bool
|
||||
""":code:`True`, if the user is allowed to pin messages"""
|
||||
can_manage_topics: bool
|
||||
""":code:`True`, if the user is allowed to create forum topics"""
|
||||
can_send_messages: bool
|
||||
""":code:`True`, if the user is allowed to send text messages, contacts, locations and venues"""
|
||||
can_send_media_messages: bool
|
||||
|
|
|
|||
|
|
@ -28,3 +28,5 @@ class ChatPermissions(MutableTelegramObject):
|
|||
"""*Optional*. :code:`True`, if the user is allowed to invite new users to the chat"""
|
||||
can_pin_messages: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to pin messages. Ignored in public supergroups"""
|
||||
can_manage_topics: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to create forum topics. If omitted defaults to the value of can_pin_messages"""
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ from .base import MutableTelegramObject
|
|||
|
||||
class ForceReply(MutableTelegramObject):
|
||||
"""
|
||||
Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice `privacy mode <https://core.telegram.org/bots#privacy-mode>`_.
|
||||
Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice `privacy mode <https://core.telegram.org/bots/features#privacy-mode>`_.
|
||||
|
||||
**Example:** A `poll bot <https://t.me/PollBot>`_ for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll:
|
||||
|
||||
|
|
|
|||
22
aiogram/types/forum_topic.py
Normal file
22
aiogram/types/forum_topic.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
||||
class ForumTopic(TelegramObject):
|
||||
"""
|
||||
This object represents a forum topic.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#forumtopic
|
||||
"""
|
||||
|
||||
message_thread_id: int
|
||||
"""Unique identifier of the forum topic"""
|
||||
name: str
|
||||
"""Name of the topic"""
|
||||
icon_color: int
|
||||
"""Color of the topic icon in RGB format"""
|
||||
icon_custom_emoji_id: Optional[str] = None
|
||||
"""*Optional*. Unique identifier of the custom emoji shown as the topic icon"""
|
||||
11
aiogram/types/forum_topic_closed.py
Normal file
11
aiogram/types/forum_topic_closed.py
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
||||
class ForumTopicClosed(TelegramObject):
|
||||
"""
|
||||
This object represents a service message about a forum topic closed in the chat. Currently holds no information.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#forumtopicclosed
|
||||
"""
|
||||
20
aiogram/types/forum_topic_created.py
Normal file
20
aiogram/types/forum_topic_created.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
||||
class ForumTopicCreated(TelegramObject):
|
||||
"""
|
||||
This object represents a service message about a new forum topic created in the chat.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#forumtopiccreated
|
||||
"""
|
||||
|
||||
name: str
|
||||
"""Name of the topic"""
|
||||
icon_color: int
|
||||
"""Color of the topic icon in RGB format"""
|
||||
icon_custom_emoji_id: Optional[str] = None
|
||||
"""*Optional*. Unique identifier of the custom emoji shown as the topic icon"""
|
||||
11
aiogram/types/forum_topic_reopened.py
Normal file
11
aiogram/types/forum_topic_reopened.py
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
||||
class ForumTopicReopened(TelegramObject):
|
||||
"""
|
||||
This object represents a service message about a forum topic reopened in the chat. Currently holds no information.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#forumtopicreopened
|
||||
"""
|
||||
|
|
@ -10,7 +10,7 @@ if TYPE_CHECKING:
|
|||
|
||||
class InlineKeyboardMarkup(MutableTelegramObject):
|
||||
"""
|
||||
This object represents an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_ that appears right next to the message it belongs to.
|
||||
This object represents an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_ that appears right next to the message it belongs to.
|
||||
**Note:** This will only work in Telegram versions released after 9 April, 2016. Older clients will display *unsupported message*.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#inlinekeyboardmarkup
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class InlineQueryResultArticle(InlineQueryResult):
|
|||
input_message_content: InputMessageContent
|
||||
"""Content of the message to be sent"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_ attached to the message"""
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_ attached to the message"""
|
||||
url: Optional[str] = None
|
||||
"""*Optional*. URL of the result"""
|
||||
hide_url: Optional[bool] = None
|
||||
|
|
|
|||
|
|
@ -40,6 +40,6 @@ class InlineQueryResultAudio(InlineQueryResult):
|
|||
audio_duration: Optional[int] = None
|
||||
"""*Optional*. Audio duration in seconds"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_ attached to the message"""
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_ attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the audio"""
|
||||
|
|
|
|||
|
|
@ -34,6 +34,6 @@ class InlineQueryResultCachedAudio(InlineQueryResult):
|
|||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_ attached to the message"""
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_ attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the audio"""
|
||||
|
|
|
|||
|
|
@ -38,6 +38,6 @@ class InlineQueryResultCachedDocument(InlineQueryResult):
|
|||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_ attached to the message"""
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_ attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the file"""
|
||||
|
|
|
|||
|
|
@ -35,6 +35,6 @@ class InlineQueryResultCachedGif(InlineQueryResult):
|
|||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_ attached to the message"""
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_ attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the GIF animation"""
|
||||
|
|
|
|||
|
|
@ -35,6 +35,6 @@ class InlineQueryResultCachedMpeg4Gif(InlineQueryResult):
|
|||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_ attached to the message"""
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_ attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the video animation"""
|
||||
|
|
|
|||
|
|
@ -37,6 +37,6 @@ class InlineQueryResultCachedPhoto(InlineQueryResult):
|
|||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_ attached to the message"""
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_ attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the photo"""
|
||||
|
|
|
|||
|
|
@ -26,6 +26,6 @@ class InlineQueryResultCachedSticker(InlineQueryResult):
|
|||
sticker_file_id: str
|
||||
"""A valid file identifier of the sticker"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_ attached to the message"""
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_ attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the sticker"""
|
||||
|
|
|
|||
|
|
@ -37,6 +37,6 @@ class InlineQueryResultCachedVideo(InlineQueryResult):
|
|||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_ attached to the message"""
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_ attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the video"""
|
||||
|
|
|
|||
|
|
@ -36,6 +36,6 @@ class InlineQueryResultCachedVoice(InlineQueryResult):
|
|||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_ attached to the message"""
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_ attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the voice message"""
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class InlineQueryResultContact(InlineQueryResult):
|
|||
vcard: Optional[str] = None
|
||||
"""*Optional*. Additional data about the contact in the form of a `vCard <https://en.wikipedia.org/wiki/VCard>`_, 0-2048 bytes"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_ attached to the message"""
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_ attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the contact"""
|
||||
thumb_url: Optional[str] = None
|
||||
|
|
|
|||
|
|
@ -25,4 +25,4 @@ class InlineQueryResultGame(InlineQueryResult):
|
|||
game_short_name: str
|
||||
"""Short name of the game"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_ attached to the message"""
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_ attached to the message"""
|
||||
|
|
|
|||
|
|
@ -45,6 +45,6 @@ class InlineQueryResultGif(InlineQueryResult):
|
|||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_ attached to the message"""
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_ attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the GIF animation"""
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class InlineQueryResultLocation(InlineQueryResult):
|
|||
proximity_alert_radius: Optional[int] = None
|
||||
"""*Optional*. For live locations, a 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
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_ attached to the message"""
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_ attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the location"""
|
||||
thumb_url: Optional[str] = None
|
||||
|
|
|
|||
|
|
@ -45,6 +45,6 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult):
|
|||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_ attached to the message"""
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_ attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the video animation"""
|
||||
|
|
|
|||
|
|
@ -43,6 +43,6 @@ class InlineQueryResultPhoto(InlineQueryResult):
|
|||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_ attached to the message"""
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_ attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the photo"""
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class InlineQueryResultVenue(InlineQueryResult):
|
|||
google_place_type: Optional[str] = None
|
||||
"""*Optional*. Google Places type of the venue. (See `supported types <https://developers.google.com/places/web-service/supported_types>`_.)"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_ attached to the message"""
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_ attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the venue"""
|
||||
thumb_url: Optional[str] = None
|
||||
|
|
|
|||
|
|
@ -49,6 +49,6 @@ class InlineQueryResultVideo(InlineQueryResult):
|
|||
description: Optional[str] = None
|
||||
"""*Optional*. Short description of the result"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_ attached to the message"""
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_ attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the video. This field is **required** if InlineQueryResultVideo is used to send an HTML-page as a result (e.g., a YouTube video)."""
|
||||
|
|
|
|||
|
|
@ -38,6 +38,6 @@ class InlineQueryResultVoice(InlineQueryResult):
|
|||
voice_duration: Optional[int] = None
|
||||
"""*Optional*. Recording duration in seconds"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_ attached to the message"""
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_ attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the voice recording"""
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ from __future__ import annotations
|
|||
|
||||
from pydantic import Field
|
||||
|
||||
from . import MenuButton
|
||||
from .menu_button import MenuButton
|
||||
|
||||
|
||||
class MenuButtonCommands(MenuButton):
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ from __future__ import annotations
|
|||
|
||||
from pydantic import Field
|
||||
|
||||
from . import MenuButton
|
||||
from .menu_button import MenuButton
|
||||
|
||||
|
||||
class MenuButtonDefault(MenuButton):
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from typing import TYPE_CHECKING
|
|||
|
||||
from pydantic import Field
|
||||
|
||||
from . import MenuButton
|
||||
from .menu_button import MenuButton
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .web_app_info import WebAppInfo
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import datetime
|
||||
from typing import TYPE_CHECKING, List, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, List, Optional, Union
|
||||
|
||||
from pydantic import Field
|
||||
|
||||
|
|
@ -48,6 +48,9 @@ if TYPE_CHECKING:
|
|||
from .dice import Dice
|
||||
from .document import Document
|
||||
from .force_reply import ForceReply
|
||||
from .forum_topic_closed import ForumTopicClosed
|
||||
from .forum_topic_created import ForumTopicCreated
|
||||
from .forum_topic_reopened import ForumTopicReopened
|
||||
from .game import Game
|
||||
from .inline_keyboard_markup import InlineKeyboardMarkup
|
||||
from .input_file import InputFile
|
||||
|
|
@ -94,6 +97,8 @@ class Message(TelegramObject):
|
|||
"""Date the message was sent in Unix time"""
|
||||
chat: Chat
|
||||
"""Conversation the message belongs to"""
|
||||
message_thread_id: Optional[int] = None
|
||||
"""*Optional*. Unique identifier of a message thread to which the message belongs; for supergroups only"""
|
||||
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."""
|
||||
sender_chat: Optional[Chat] = None
|
||||
|
|
@ -110,6 +115,8 @@ class Message(TelegramObject):
|
|||
"""*Optional*. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages"""
|
||||
forward_date: Optional[int] = None
|
||||
"""*Optional*. For forwarded messages, date the original message was sent in Unix time"""
|
||||
is_topic_message: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the message is sent to a forum topic"""
|
||||
is_automatic_forward: Optional[bool] = None
|
||||
"""*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
|
||||
|
|
@ -194,6 +201,12 @@ class Message(TelegramObject):
|
|||
"""*Optional*. Telegram Passport data"""
|
||||
proximity_alert_triggered: Optional[ProximityAlertTriggered] = None
|
||||
"""*Optional*. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location."""
|
||||
forum_topic_created: Optional[ForumTopicCreated] = None
|
||||
"""*Optional*. Service message: forum topic created"""
|
||||
forum_topic_closed: Optional[ForumTopicClosed] = None
|
||||
"""*Optional*. Service message: forum topic closed"""
|
||||
forum_topic_reopened: Optional[ForumTopicReopened] = None
|
||||
"""*Optional*. Service message: forum topic reopened"""
|
||||
video_chat_scheduled: Optional[VideoChatScheduled] = None
|
||||
"""*Optional*. Service message: video chat scheduled"""
|
||||
video_chat_started: Optional[VideoChatStarted] = None
|
||||
|
|
@ -273,6 +286,12 @@ class Message(TelegramObject):
|
|||
return ContentType.DICE
|
||||
if self.message_auto_delete_timer_changed:
|
||||
return ContentType.MESSAGE_AUTO_DELETE_TIMER_CHANGED
|
||||
if self.forum_topic_created:
|
||||
return ContentType.FORUM_TOPIC_CREATED
|
||||
if self.forum_topic_closed:
|
||||
return ContentType.FORUM_TOPIC_CLOSED
|
||||
if self.forum_topic_reopened:
|
||||
return ContentType.FORUM_TOPIC_REOPENED
|
||||
if self.video_chat_scheduled:
|
||||
return ContentType.VIDEO_CHAT_SCHEDULED
|
||||
if self.video_chat_started:
|
||||
|
|
@ -313,6 +332,7 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendAnimation:
|
||||
"""
|
||||
Reply with animation
|
||||
|
|
@ -344,6 +364,8 @@ class Message(TelegramObject):
|
|||
reply_to_message_id=self.message_id,
|
||||
allow_sending_without_reply=allow_sending_without_reply,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def answer_animation(
|
||||
|
|
@ -359,6 +381,7 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendAnimation:
|
||||
"""
|
||||
Answer with animation
|
||||
|
|
@ -388,6 +411,8 @@ class Message(TelegramObject):
|
|||
disable_notification=disable_notification,
|
||||
reply_to_message_id=None,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def reply_audio(
|
||||
|
|
@ -404,6 +429,7 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendAudio:
|
||||
"""
|
||||
Reply with audio
|
||||
|
|
@ -435,6 +461,8 @@ class Message(TelegramObject):
|
|||
reply_to_message_id=self.message_id,
|
||||
allow_sending_without_reply=allow_sending_without_reply,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def answer_audio(
|
||||
|
|
@ -450,6 +478,7 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendAudio:
|
||||
"""
|
||||
Answer with audio
|
||||
|
|
@ -479,6 +508,8 @@ class Message(TelegramObject):
|
|||
disable_notification=disable_notification,
|
||||
reply_to_message_id=None,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def reply_contact(
|
||||
|
|
@ -492,6 +523,7 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendContact:
|
||||
"""
|
||||
Reply with contact
|
||||
|
|
@ -517,6 +549,8 @@ class Message(TelegramObject):
|
|||
reply_to_message_id=self.message_id,
|
||||
allow_sending_without_reply=allow_sending_without_reply,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def answer_contact(
|
||||
|
|
@ -529,6 +563,7 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendContact:
|
||||
"""
|
||||
Answer with contact
|
||||
|
|
@ -552,6 +587,8 @@ class Message(TelegramObject):
|
|||
disable_notification=disable_notification,
|
||||
reply_to_message_id=None,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def reply_document(
|
||||
|
|
@ -565,6 +602,7 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendDocument:
|
||||
"""
|
||||
Reply with document
|
||||
|
|
@ -590,6 +628,8 @@ class Message(TelegramObject):
|
|||
reply_to_message_id=self.message_id,
|
||||
allow_sending_without_reply=allow_sending_without_reply,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def answer_document(
|
||||
|
|
@ -602,6 +642,7 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendDocument:
|
||||
"""
|
||||
Answer with document
|
||||
|
|
@ -625,6 +666,8 @@ class Message(TelegramObject):
|
|||
disable_notification=disable_notification,
|
||||
reply_to_message_id=None,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def reply_game(
|
||||
|
|
@ -633,6 +676,7 @@ class Message(TelegramObject):
|
|||
disable_notification: Optional[bool] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendGame:
|
||||
"""
|
||||
Reply with game
|
||||
|
|
@ -652,6 +696,8 @@ class Message(TelegramObject):
|
|||
reply_to_message_id=self.message_id,
|
||||
allow_sending_without_reply=allow_sending_without_reply,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def answer_game(
|
||||
|
|
@ -659,6 +705,7 @@ class Message(TelegramObject):
|
|||
game_short_name: str,
|
||||
disable_notification: Optional[bool] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendGame:
|
||||
"""
|
||||
Answer with game
|
||||
|
|
@ -676,6 +723,8 @@ class Message(TelegramObject):
|
|||
disable_notification=disable_notification,
|
||||
reply_to_message_id=None,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def reply_invoice(
|
||||
|
|
@ -705,6 +754,7 @@ class Message(TelegramObject):
|
|||
protect_content: Optional[bool] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendInvoice:
|
||||
"""
|
||||
Reply with invoice
|
||||
|
|
@ -766,6 +816,8 @@ class Message(TelegramObject):
|
|||
reply_to_message_id=self.message_id,
|
||||
allow_sending_without_reply=allow_sending_without_reply,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def answer_invoice(
|
||||
|
|
@ -794,6 +846,7 @@ class Message(TelegramObject):
|
|||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendInvoice:
|
||||
"""
|
||||
Answer with invoice
|
||||
|
|
@ -853,6 +906,8 @@ class Message(TelegramObject):
|
|||
protect_content=protect_content,
|
||||
reply_to_message_id=None,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def reply_location(
|
||||
|
|
@ -865,6 +920,7 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendLocation:
|
||||
"""
|
||||
Reply with location
|
||||
|
|
@ -888,6 +944,8 @@ class Message(TelegramObject):
|
|||
reply_to_message_id=self.message_id,
|
||||
allow_sending_without_reply=allow_sending_without_reply,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def answer_location(
|
||||
|
|
@ -899,6 +957,7 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendLocation:
|
||||
"""
|
||||
Answer with location
|
||||
|
|
@ -920,6 +979,8 @@ class Message(TelegramObject):
|
|||
disable_notification=disable_notification,
|
||||
reply_to_message_id=None,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def reply_media_group(
|
||||
|
|
@ -927,6 +988,7 @@ class Message(TelegramObject):
|
|||
media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]],
|
||||
disable_notification: Optional[bool] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendMediaGroup:
|
||||
"""
|
||||
Reply with media group
|
||||
|
|
@ -944,12 +1006,15 @@ class Message(TelegramObject):
|
|||
disable_notification=disable_notification,
|
||||
reply_to_message_id=self.message_id,
|
||||
allow_sending_without_reply=allow_sending_without_reply,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def answer_media_group(
|
||||
self,
|
||||
media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]],
|
||||
disable_notification: Optional[bool] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendMediaGroup:
|
||||
"""
|
||||
Answer with media group
|
||||
|
|
@ -965,6 +1030,8 @@ class Message(TelegramObject):
|
|||
media=media,
|
||||
disable_notification=disable_notification,
|
||||
reply_to_message_id=None,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def reply(
|
||||
|
|
@ -977,6 +1044,7 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendMessage:
|
||||
"""
|
||||
Reply with text message
|
||||
|
|
@ -1000,6 +1068,8 @@ class Message(TelegramObject):
|
|||
reply_to_message_id=self.message_id,
|
||||
allow_sending_without_reply=allow_sending_without_reply,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def answer(
|
||||
|
|
@ -1011,6 +1081,7 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendMessage:
|
||||
"""
|
||||
Answer with text message
|
||||
|
|
@ -1032,6 +1103,8 @@ class Message(TelegramObject):
|
|||
disable_notification=disable_notification,
|
||||
reply_to_message_id=None,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def reply_photo(
|
||||
|
|
@ -1044,6 +1117,7 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendPhoto:
|
||||
"""
|
||||
Reply with photo
|
||||
|
|
@ -1067,6 +1141,8 @@ class Message(TelegramObject):
|
|||
reply_to_message_id=self.message_id,
|
||||
allow_sending_without_reply=allow_sending_without_reply,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def answer_photo(
|
||||
|
|
@ -1078,6 +1154,7 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendPhoto:
|
||||
"""
|
||||
Answer with photo
|
||||
|
|
@ -1099,6 +1176,8 @@ class Message(TelegramObject):
|
|||
disable_notification=disable_notification,
|
||||
reply_to_message_id=None,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def reply_poll(
|
||||
|
|
@ -1119,6 +1198,7 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendPoll:
|
||||
"""
|
||||
Reply with poll
|
||||
|
|
@ -1158,6 +1238,8 @@ class Message(TelegramObject):
|
|||
reply_to_message_id=self.message_id,
|
||||
allow_sending_without_reply=allow_sending_without_reply,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def answer_poll(
|
||||
|
|
@ -1177,6 +1259,7 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendPoll:
|
||||
"""
|
||||
Answer with poll
|
||||
|
|
@ -1214,6 +1297,8 @@ class Message(TelegramObject):
|
|||
disable_notification=disable_notification,
|
||||
reply_to_message_id=None,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def reply_dice(
|
||||
|
|
@ -1224,6 +1309,7 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendDice:
|
||||
"""
|
||||
Reply with dice
|
||||
|
|
@ -1243,6 +1329,8 @@ class Message(TelegramObject):
|
|||
reply_to_message_id=self.message_id,
|
||||
allow_sending_without_reply=allow_sending_without_reply,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def answer_dice(
|
||||
|
|
@ -1252,6 +1340,7 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendDice:
|
||||
"""
|
||||
Answer with dice
|
||||
|
|
@ -1269,6 +1358,8 @@ class Message(TelegramObject):
|
|||
disable_notification=disable_notification,
|
||||
reply_to_message_id=None,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def reply_sticker(
|
||||
|
|
@ -1279,6 +1370,7 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendSticker:
|
||||
"""
|
||||
Reply with sticker
|
||||
|
|
@ -1298,6 +1390,8 @@ class Message(TelegramObject):
|
|||
reply_to_message_id=self.message_id,
|
||||
allow_sending_without_reply=allow_sending_without_reply,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def answer_sticker(
|
||||
|
|
@ -1307,6 +1401,7 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendSticker:
|
||||
"""
|
||||
Answer with sticker
|
||||
|
|
@ -1324,6 +1419,8 @@ class Message(TelegramObject):
|
|||
disable_notification=disable_notification,
|
||||
reply_to_message_id=None,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def reply_venue(
|
||||
|
|
@ -1339,6 +1436,7 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendVenue:
|
||||
"""
|
||||
Reply with venue
|
||||
|
|
@ -1368,6 +1466,8 @@ class Message(TelegramObject):
|
|||
reply_to_message_id=self.message_id,
|
||||
allow_sending_without_reply=allow_sending_without_reply,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def answer_venue(
|
||||
|
|
@ -1382,6 +1482,7 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendVenue:
|
||||
"""
|
||||
Answer with venue
|
||||
|
|
@ -1409,6 +1510,8 @@ class Message(TelegramObject):
|
|||
disable_notification=disable_notification,
|
||||
reply_to_message_id=None,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def reply_video(
|
||||
|
|
@ -1426,6 +1529,7 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendVideo:
|
||||
"""
|
||||
Reply with video
|
||||
|
|
@ -1459,6 +1563,8 @@ class Message(TelegramObject):
|
|||
reply_to_message_id=self.message_id,
|
||||
allow_sending_without_reply=allow_sending_without_reply,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def answer_video(
|
||||
|
|
@ -1475,6 +1581,7 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendVideo:
|
||||
"""
|
||||
Answer with video
|
||||
|
|
@ -1506,6 +1613,8 @@ class Message(TelegramObject):
|
|||
disable_notification=disable_notification,
|
||||
reply_to_message_id=None,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def reply_video_note(
|
||||
|
|
@ -1519,6 +1628,7 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendVideoNote:
|
||||
"""
|
||||
Reply wit video note
|
||||
|
|
@ -1544,6 +1654,8 @@ class Message(TelegramObject):
|
|||
reply_to_message_id=self.message_id,
|
||||
allow_sending_without_reply=allow_sending_without_reply,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def answer_video_note(
|
||||
|
|
@ -1556,6 +1668,7 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendVideoNote:
|
||||
"""
|
||||
Answer wit video note
|
||||
|
|
@ -1579,6 +1692,8 @@ class Message(TelegramObject):
|
|||
disable_notification=disable_notification,
|
||||
reply_to_message_id=None,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def reply_voice(
|
||||
|
|
@ -1592,6 +1707,7 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendVoice:
|
||||
"""
|
||||
Reply with voice
|
||||
|
|
@ -1617,6 +1733,8 @@ class Message(TelegramObject):
|
|||
reply_to_message_id=self.message_id,
|
||||
allow_sending_without_reply=allow_sending_without_reply,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def answer_voice(
|
||||
|
|
@ -1629,6 +1747,7 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendVoice:
|
||||
"""
|
||||
Answer with voice
|
||||
|
|
@ -1652,6 +1771,8 @@ class Message(TelegramObject):
|
|||
disable_notification=disable_notification,
|
||||
reply_to_message_id=None,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def send_copy(
|
||||
|
|
@ -1660,6 +1781,8 @@ class Message(TelegramObject):
|
|||
disable_notification: Optional[bool] = None,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
reply_markup: Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, None] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
message_thread_id: Optional[int] = None,
|
||||
) -> Union[
|
||||
SendAnimation,
|
||||
SendAudio,
|
||||
|
|
@ -1691,6 +1814,7 @@ class Message(TelegramObject):
|
|||
:param disable_notification:
|
||||
:param reply_to_message_id:
|
||||
:param reply_markup:
|
||||
:param message_thread_id:
|
||||
:return:
|
||||
"""
|
||||
from ..methods import (
|
||||
|
|
@ -1715,6 +1839,8 @@ class Message(TelegramObject):
|
|||
"reply_markup": reply_markup or self.reply_markup,
|
||||
"disable_notification": disable_notification,
|
||||
"reply_to_message_id": reply_to_message_id,
|
||||
"message_thread_id": message_thread_id,
|
||||
"allow_sending_without_reply": allow_sending_without_reply,
|
||||
}
|
||||
text = self.text or self.caption
|
||||
entities = self.entities or self.caption_entities
|
||||
|
|
@ -1798,6 +1924,7 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
**kwargs: Any,
|
||||
) -> CopyMessage:
|
||||
"""
|
||||
Copy message
|
||||
|
|
@ -1825,6 +1952,8 @@ class Message(TelegramObject):
|
|||
reply_to_message_id=reply_to_message_id,
|
||||
allow_sending_without_reply=allow_sending_without_reply,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def edit_text(
|
||||
|
|
@ -1834,6 +1963,7 @@ class Message(TelegramObject):
|
|||
entities: Optional[List[MessageEntity]] = None,
|
||||
disable_web_page_preview: Optional[bool] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
**kwargs: Any,
|
||||
) -> EditMessageText:
|
||||
from ..methods import EditMessageText
|
||||
|
||||
|
|
@ -1845,6 +1975,8 @@ class Message(TelegramObject):
|
|||
entities=entities,
|
||||
disable_web_page_preview=disable_web_page_preview,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def forward(
|
||||
|
|
@ -1852,6 +1984,7 @@ class Message(TelegramObject):
|
|||
chat_id: Union[int, str],
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
**kwargs: Any,
|
||||
) -> ForwardMessage:
|
||||
from ..methods import ForwardMessage
|
||||
|
||||
|
|
@ -1861,12 +1994,15 @@ class Message(TelegramObject):
|
|||
message_id=self.message_id,
|
||||
disable_notification=disable_notification,
|
||||
protect_content=protect_content,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def edit_media(
|
||||
self,
|
||||
media: InputMedia,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
**kwargs: Any,
|
||||
) -> EditMessageMedia:
|
||||
from ..methods import EditMessageMedia
|
||||
|
||||
|
|
@ -1875,11 +2011,14 @@ class Message(TelegramObject):
|
|||
chat_id=self.chat.id,
|
||||
message_id=self.message_id,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def edit_reply_markup(
|
||||
self,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
**kwargs: Any,
|
||||
) -> EditMessageReplyMarkup:
|
||||
from ..methods import EditMessageReplyMarkup
|
||||
|
||||
|
|
@ -1887,6 +2026,8 @@ class Message(TelegramObject):
|
|||
chat_id=self.chat.id,
|
||||
message_id=self.message_id,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def delete_reply_markup(self) -> EditMessageReplyMarkup:
|
||||
|
|
@ -1900,6 +2041,7 @@ class Message(TelegramObject):
|
|||
heading: Optional[int] = None,
|
||||
proximity_alert_radius: Optional[int] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
**kwargs: Any,
|
||||
) -> EditMessageLiveLocation:
|
||||
from ..methods import EditMessageLiveLocation
|
||||
|
||||
|
|
@ -1912,11 +2054,14 @@ class Message(TelegramObject):
|
|||
heading=heading,
|
||||
proximity_alert_radius=proximity_alert_radius,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def stop_live_location(
|
||||
self,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
**kwargs: Any,
|
||||
) -> StopMessageLiveLocation:
|
||||
from ..methods import StopMessageLiveLocation
|
||||
|
||||
|
|
@ -1924,6 +2069,8 @@ class Message(TelegramObject):
|
|||
chat_id=self.chat.id,
|
||||
message_id=self.message_id,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def edit_caption(
|
||||
|
|
@ -1932,6 +2079,7 @@ class Message(TelegramObject):
|
|||
parse_mode: Optional[str] = UNSET,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
**kwargs: Any,
|
||||
) -> EditMessageCaption:
|
||||
from ..methods import EditMessageCaption
|
||||
|
||||
|
|
@ -1942,16 +2090,27 @@ class Message(TelegramObject):
|
|||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
reply_markup=reply_markup,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def delete(self) -> DeleteMessage:
|
||||
def delete(
|
||||
self,
|
||||
**kwargs: Any,
|
||||
) -> DeleteMessage:
|
||||
from ..methods import DeleteMessage
|
||||
|
||||
return DeleteMessage(chat_id=self.chat.id, message_id=self.message_id)
|
||||
return DeleteMessage(
|
||||
chat_id=self.chat.id,
|
||||
message_id=self.message_id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def pin(
|
||||
self,
|
||||
disable_notification: Optional[bool] = None,
|
||||
**kwargs: Any,
|
||||
) -> PinChatMessage:
|
||||
from ..methods import PinChatMessage
|
||||
|
||||
|
|
@ -1959,14 +2118,21 @@ class Message(TelegramObject):
|
|||
chat_id=self.chat.id,
|
||||
message_id=self.message_id,
|
||||
disable_notification=disable_notification,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def unpin(self) -> UnpinChatMessage:
|
||||
def unpin(
|
||||
self,
|
||||
**kwargs: Any,
|
||||
) -> UnpinChatMessage:
|
||||
from ..methods import UnpinChatMessage
|
||||
|
||||
return UnpinChatMessage(
|
||||
chat_id=self.chat.id,
|
||||
message_id=self.message_id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def get_url(self, force_private: bool = False) -> Optional[str]:
|
||||
|
|
@ -2024,6 +2190,9 @@ class ContentType(helper.Helper):
|
|||
POLL = helper.Item() # poll
|
||||
DICE = helper.Item() # dice
|
||||
MESSAGE_AUTO_DELETE_TIMER_CHANGED = helper.Item() # message_auto_delete_timer_changed
|
||||
FORUM_TOPIC_CREATED = helper.Item() # forum_topic_created
|
||||
FORUM_TOPIC_CLOSED = helper.Item() # forum_topic_closed
|
||||
FORUM_TOPIC_REOPENED = helper.Item() # forum_topic_reopened
|
||||
VIDEO_CHAT_SCHEDULED = helper.Item() # video_chat_scheduled
|
||||
VIDEO_CHAT_STARTED = helper.Item() # video_chat_started
|
||||
VIDEO_CHAT_ENDED = helper.Item() # video_chat_ended
|
||||
|
|
|
|||
|
|
@ -2,14 +2,15 @@ from __future__ import annotations
|
|||
|
||||
from typing import Optional
|
||||
|
||||
from ..utils.link import create_tg_link
|
||||
from ..utils import markdown
|
||||
from ..utils.link import create_tg_link
|
||||
from .base import TelegramObject
|
||||
|
||||
|
||||
class User(TelegramObject):
|
||||
"""
|
||||
This object represents a Telegram user or bot.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#user
|
||||
"""
|
||||
|
||||
|
|
@ -32,7 +33,7 @@ class User(TelegramObject):
|
|||
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`."""
|
||||
can_read_all_group_messages: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if `privacy mode <https://core.telegram.org/bots#privacy-mode>`_ is disabled for the bot. Returned only in :class:`aiogram.methods.get_me.GetMe`."""
|
||||
"""*Optional*. :code:`True`, if `privacy mode <https://core.telegram.org/bots/features#privacy-mode>`_ is disabled for the bot. Returned only in :class:`aiogram.methods.get_me.GetMe`."""
|
||||
supports_inline_queries: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the bot supports inline queries. Returned only in :class:`aiogram.methods.get_me.GetMe`."""
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
pass
|
||||
|
||||
|
||||
class VideoChatEnded(TelegramObject):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
import datetime
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
|
@ -12,5 +12,5 @@ class VideoChatScheduled(TelegramObject):
|
|||
Source: https://core.telegram.org/bots/api#videochatscheduled
|
||||
"""
|
||||
|
||||
start_date: datetime
|
||||
start_date: datetime.datetime
|
||||
"""Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator"""
|
||||
|
|
|
|||
44
docs/api/methods/close_forum_topic.rst
Normal file
44
docs/api/methods/close_forum_topic.rst
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
###############
|
||||
closeForumTopic
|
||||
###############
|
||||
|
||||
Returns: :obj:`bool`
|
||||
|
||||
.. automodule:: aiogram.methods.close_forum_topic
|
||||
:members:
|
||||
:member-order: bysource
|
||||
:undoc-members: True
|
||||
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
As bot method
|
||||
-------------
|
||||
|
||||
.. code-block::
|
||||
|
||||
result: bool = await bot.close_forum_topic(...)
|
||||
|
||||
|
||||
Method as object
|
||||
----------------
|
||||
|
||||
Imports:
|
||||
|
||||
- :code:`from aiogram.methods.close_forum_topic import CloseForumTopic`
|
||||
- alias: :code:`from aiogram.methods import CloseForumTopic`
|
||||
|
||||
With specific bot
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
result: bool = await bot(CloseForumTopic(...))
|
||||
|
||||
As reply into Webhook in handler
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
return CloseForumTopic(...)
|
||||
44
docs/api/methods/create_forum_topic.rst
Normal file
44
docs/api/methods/create_forum_topic.rst
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
################
|
||||
createForumTopic
|
||||
################
|
||||
|
||||
Returns: :obj:`ForumTopic`
|
||||
|
||||
.. automodule:: aiogram.methods.create_forum_topic
|
||||
:members:
|
||||
:member-order: bysource
|
||||
:undoc-members: True
|
||||
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
As bot method
|
||||
-------------
|
||||
|
||||
.. code-block::
|
||||
|
||||
result: ForumTopic = await bot.create_forum_topic(...)
|
||||
|
||||
|
||||
Method as object
|
||||
----------------
|
||||
|
||||
Imports:
|
||||
|
||||
- :code:`from aiogram.methods.create_forum_topic import CreateForumTopic`
|
||||
- alias: :code:`from aiogram.methods import CreateForumTopic`
|
||||
|
||||
With specific bot
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
result: ForumTopic = await bot(CreateForumTopic(...))
|
||||
|
||||
As reply into Webhook in handler
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
return CreateForumTopic(...)
|
||||
44
docs/api/methods/delete_forum_topic.rst
Normal file
44
docs/api/methods/delete_forum_topic.rst
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
################
|
||||
deleteForumTopic
|
||||
################
|
||||
|
||||
Returns: :obj:`bool`
|
||||
|
||||
.. automodule:: aiogram.methods.delete_forum_topic
|
||||
:members:
|
||||
:member-order: bysource
|
||||
:undoc-members: True
|
||||
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
As bot method
|
||||
-------------
|
||||
|
||||
.. code-block::
|
||||
|
||||
result: bool = await bot.delete_forum_topic(...)
|
||||
|
||||
|
||||
Method as object
|
||||
----------------
|
||||
|
||||
Imports:
|
||||
|
||||
- :code:`from aiogram.methods.delete_forum_topic import DeleteForumTopic`
|
||||
- alias: :code:`from aiogram.methods import DeleteForumTopic`
|
||||
|
||||
With specific bot
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
result: bool = await bot(DeleteForumTopic(...))
|
||||
|
||||
As reply into Webhook in handler
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
return DeleteForumTopic(...)
|
||||
44
docs/api/methods/edit_forum_topic.rst
Normal file
44
docs/api/methods/edit_forum_topic.rst
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
##############
|
||||
editForumTopic
|
||||
##############
|
||||
|
||||
Returns: :obj:`bool`
|
||||
|
||||
.. automodule:: aiogram.methods.edit_forum_topic
|
||||
:members:
|
||||
:member-order: bysource
|
||||
:undoc-members: True
|
||||
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
As bot method
|
||||
-------------
|
||||
|
||||
.. code-block::
|
||||
|
||||
result: bool = await bot.edit_forum_topic(...)
|
||||
|
||||
|
||||
Method as object
|
||||
----------------
|
||||
|
||||
Imports:
|
||||
|
||||
- :code:`from aiogram.methods.edit_forum_topic import EditForumTopic`
|
||||
- alias: :code:`from aiogram.methods import EditForumTopic`
|
||||
|
||||
With specific bot
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
result: bool = await bot(EditForumTopic(...))
|
||||
|
||||
As reply into Webhook in handler
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
return EditForumTopic(...)
|
||||
|
|
@ -21,14 +21,6 @@ As bot method
|
|||
result: Union[Message, bool] = await bot.edit_message_live_location(...)
|
||||
|
||||
|
||||
As message method
|
||||
-----------------
|
||||
|
||||
.. code-block::
|
||||
|
||||
result: Union[Message, bool] = await message.edit_live_location(...)
|
||||
|
||||
|
||||
Method as object
|
||||
----------------
|
||||
|
||||
|
|
|
|||
|
|
@ -21,14 +21,6 @@ As bot method
|
|||
result: Union[Message, bool] = await bot.edit_message_media(...)
|
||||
|
||||
|
||||
As message method
|
||||
-----------------
|
||||
|
||||
.. code-block::
|
||||
|
||||
result: Union[Message, bool] = await message.edit_media(...)
|
||||
|
||||
|
||||
Method as object
|
||||
----------------
|
||||
|
||||
|
|
|
|||
|
|
@ -21,14 +21,6 @@ As bot method
|
|||
result: Message = await bot.forward_message(...)
|
||||
|
||||
|
||||
As message method
|
||||
-------------
|
||||
|
||||
.. code-block::
|
||||
|
||||
result: Message = await message.forward(...)
|
||||
|
||||
|
||||
Method as object
|
||||
----------------
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
getChatMenuButton
|
||||
#################
|
||||
|
||||
Returns: :obj:`MenuButton`
|
||||
Returns: :obj:`Union[MenuButtonDefault, MenuButtonWebApp, MenuButtonCommands]`
|
||||
|
||||
.. automodule:: aiogram.methods.get_chat_menu_button
|
||||
:members:
|
||||
|
|
@ -18,7 +18,7 @@ As bot method
|
|||
|
||||
.. code-block::
|
||||
|
||||
result: MenuButton = await bot.get_chat_menu_button(...)
|
||||
result: Union[MenuButtonDefault, MenuButtonWebApp, MenuButtonCommands] = await bot.get_chat_menu_button(...)
|
||||
|
||||
|
||||
Method as object
|
||||
|
|
@ -34,4 +34,4 @@ With specific bot
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
result: MenuButton = await bot(GetChatMenuButton(...))
|
||||
result: Union[MenuButtonDefault, MenuButtonWebApp, MenuButtonCommands] = await bot(GetChatMenuButton(...))
|
||||
|
|
|
|||
37
docs/api/methods/get_forum_topic_icon_stickers.rst
Normal file
37
docs/api/methods/get_forum_topic_icon_stickers.rst
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#########################
|
||||
getForumTopicIconStickers
|
||||
#########################
|
||||
|
||||
Returns: :obj:`List[Sticker]`
|
||||
|
||||
.. automodule:: aiogram.methods.get_forum_topic_icon_stickers
|
||||
:members:
|
||||
:member-order: bysource
|
||||
:undoc-members: True
|
||||
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
As bot method
|
||||
-------------
|
||||
|
||||
.. code-block::
|
||||
|
||||
result: List[Sticker] = await bot.get_forum_topic_icon_stickers(...)
|
||||
|
||||
|
||||
Method as object
|
||||
----------------
|
||||
|
||||
Imports:
|
||||
|
||||
- :code:`from aiogram.methods.get_forum_topic_icon_stickers import GetForumTopicIconStickers`
|
||||
- alias: :code:`from aiogram.methods import GetForumTopicIconStickers`
|
||||
|
||||
With specific bot
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
result: List[Sticker] = await bot(GetForumTopicIconStickers(...))
|
||||
|
|
@ -78,6 +78,13 @@ Available methods
|
|||
get_chat_member
|
||||
set_chat_sticker_set
|
||||
delete_chat_sticker_set
|
||||
get_forum_topic_icon_stickers
|
||||
create_forum_topic
|
||||
edit_forum_topic
|
||||
close_forum_topic
|
||||
reopen_forum_topic
|
||||
delete_forum_topic
|
||||
unpin_all_forum_topic_messages
|
||||
answer_callback_query
|
||||
set_my_commands
|
||||
delete_my_commands
|
||||
|
|
|
|||
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