3.x Bot API 6.3

This commit is contained in:
katant 2022-11-06 05:49:15 +10:00
parent 3ae5d904c9
commit 6d649bbb1a
22 changed files with 143 additions and 0 deletions

View file

@ -548,6 +548,7 @@ class Bot(ContextInstanceMixin["Bot"]):
self,
chat_id: Union[int, str],
text: str,
message_thread_id: Optional[bool] = None,
parse_mode: Optional[str] = UNSET,
entities: Optional[List[MessageEntity]] = None,
disable_web_page_preview: Optional[bool] = None,
@ -566,6 +567,7 @@ class Bot(ContextInstanceMixin["Bot"]):
Source: https://core.telegram.org/bots/api#sendmessage
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param text: Text of the message to be sent, 1-4096 characters after entities parsing
: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*
@ -580,6 +582,7 @@ class Bot(ContextInstanceMixin["Bot"]):
"""
call = SendMessage(
chat_id=chat_id,
message_thread_id=message_thread_id,
text=text,
parse_mode=parse_mode,
entities=entities,
@ -597,6 +600,7 @@ class Bot(ContextInstanceMixin["Bot"]):
chat_id: Union[int, str],
from_chat_id: Union[int, str],
message_id: int,
message_thread_id: Optional[bool] = None,
disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = None,
request_timeout: Optional[int] = None,
@ -607,6 +611,7 @@ class Bot(ContextInstanceMixin["Bot"]):
Source: https://core.telegram.org/bots/api#forwardmessage
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
: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 disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
@ -616,6 +621,7 @@ class Bot(ContextInstanceMixin["Bot"]):
"""
call = ForwardMessage(
chat_id=chat_id,
message_thread_id=message_thread_id,
from_chat_id=from_chat_id,
message_id=message_id,
disable_notification=disable_notification,
@ -628,6 +634,7 @@ class Bot(ContextInstanceMixin["Bot"]):
chat_id: Union[int, str],
from_chat_id: Union[int, str],
message_id: int,
message_thread_id: Optional[bool] = None,
caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET,
caption_entities: Optional[List[MessageEntity]] = None,
@ -646,6 +653,7 @@ class Bot(ContextInstanceMixin["Bot"]):
Source: https://core.telegram.org/bots/api#copymessage
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
: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 caption: New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept
@ -661,6 +669,7 @@ class Bot(ContextInstanceMixin["Bot"]):
"""
call = CopyMessage(
chat_id=chat_id,
message_thread_id=message_thread_id,
from_chat_id=from_chat_id,
message_id=message_id,
caption=caption,
@ -679,6 +688,7 @@ class Bot(ContextInstanceMixin["Bot"]):
chat_id: Union[int, str],
photo: Union[InputFile, str],
caption: Optional[str] = None,
message_thread_id: Optional[bool] = None,
parse_mode: Optional[str] = UNSET,
caption_entities: Optional[List[MessageEntity]] = None,
disable_notification: Optional[bool] = None,
@ -696,6 +706,7 @@ class Bot(ContextInstanceMixin["Bot"]):
Source: https://core.telegram.org/bots/api#sendphoto
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param photo: Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. :ref:`More information on Sending Files » <sending-files>`
:param caption: Photo caption (may also be used when resending photos by *file_id*), 0-1024 characters after entities parsing
:param parse_mode: Mode for parsing entities in the photo caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
@ -710,6 +721,7 @@ class Bot(ContextInstanceMixin["Bot"]):
"""
call = SendPhoto(
chat_id=chat_id,
message_thread_id=message_thread_id,
photo=photo,
caption=caption,
parse_mode=parse_mode,
@ -727,6 +739,7 @@ class Bot(ContextInstanceMixin["Bot"]):
chat_id: Union[int, str],
audio: Union[InputFile, str],
caption: Optional[str] = None,
message_thread_id: Optional[bool] = None,
parse_mode: Optional[str] = UNSET,
caption_entities: Optional[List[MessageEntity]] = None,
duration: Optional[int] = None,
@ -749,6 +762,7 @@ class Bot(ContextInstanceMixin["Bot"]):
Source: https://core.telegram.org/bots/api#sendaudio
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param audio: Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`
:param caption: Audio caption, 0-1024 characters after entities parsing
:param parse_mode: Mode for parsing entities in the audio caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
@ -767,6 +781,7 @@ class Bot(ContextInstanceMixin["Bot"]):
"""
call = SendAudio(
chat_id=chat_id,
message_thread_id=message_thread_id,
audio=audio,
caption=caption,
parse_mode=parse_mode,
@ -789,6 +804,7 @@ class Bot(ContextInstanceMixin["Bot"]):
document: Union[InputFile, str],
thumb: Optional[Union[InputFile, str]] = None,
caption: Optional[str] = None,
message_thread_id: Optional[bool] = None,
parse_mode: Optional[str] = UNSET,
caption_entities: Optional[List[MessageEntity]] = None,
disable_content_type_detection: Optional[bool] = None,
@ -807,6 +823,7 @@ class Bot(ContextInstanceMixin["Bot"]):
Source: https://core.telegram.org/bots/api#senddocument
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param document: File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`
:param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More 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
@ -823,6 +840,7 @@ class Bot(ContextInstanceMixin["Bot"]):
"""
call = SendDocument(
chat_id=chat_id,
message_thread_id=message_thread_id,
document=document,
thumb=thumb,
caption=caption,
@ -846,6 +864,7 @@ class Bot(ContextInstanceMixin["Bot"]):
height: Optional[int] = None,
thumb: Optional[Union[InputFile, str]] = None,
caption: Optional[str] = None,
message_thread_id: Optional[bool] = None,
parse_mode: Optional[str] = UNSET,
caption_entities: Optional[List[MessageEntity]] = None,
supports_streaming: Optional[bool] = None,
@ -864,6 +883,7 @@ class Bot(ContextInstanceMixin["Bot"]):
Source: https://core.telegram.org/bots/api#sendvideo
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param video: Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`
:param duration: Duration of sent video in seconds
:param width: Video width
@ -883,6 +903,7 @@ class Bot(ContextInstanceMixin["Bot"]):
"""
call = SendVideo(
chat_id=chat_id,
message_thread_id=message_thread_id,
video=video,
duration=duration,
width=width,
@ -909,6 +930,7 @@ class Bot(ContextInstanceMixin["Bot"]):
height: Optional[int] = None,
thumb: Optional[Union[InputFile, str]] = None,
caption: Optional[str] = None,
message_thread_id: Optional[bool] = None,
parse_mode: Optional[str] = UNSET,
caption_entities: Optional[List[MessageEntity]] = None,
disable_notification: Optional[bool] = None,
@ -926,6 +948,7 @@ class Bot(ContextInstanceMixin["Bot"]):
Source: https://core.telegram.org/bots/api#sendanimation
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param animation: Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`
:param duration: Duration of sent animation in seconds
:param width: Animation width
@ -944,6 +967,7 @@ class Bot(ContextInstanceMixin["Bot"]):
"""
call = SendAnimation(
chat_id=chat_id,
message_thread_id=message_thread_id,
animation=animation,
duration=duration,
width=width,
@ -965,6 +989,7 @@ class Bot(ContextInstanceMixin["Bot"]):
chat_id: Union[int, str],
voice: Union[InputFile, str],
caption: Optional[str] = None,
message_thread_id: Optional[bool] = None,
parse_mode: Optional[str] = UNSET,
caption_entities: Optional[List[MessageEntity]] = None,
duration: Optional[int] = None,
@ -983,6 +1008,7 @@ class Bot(ContextInstanceMixin["Bot"]):
Source: https://core.telegram.org/bots/api#sendvoice
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param voice: Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`
:param caption: Voice message caption, 0-1024 characters after entities parsing
:param 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.
@ -998,6 +1024,7 @@ class Bot(ContextInstanceMixin["Bot"]):
"""
call = SendVoice(
chat_id=chat_id,
message_thread_id=message_thread_id,
voice=voice,
caption=caption,
parse_mode=parse_mode,
@ -1018,6 +1045,7 @@ class Bot(ContextInstanceMixin["Bot"]):
duration: Optional[int] = None,
length: Optional[int] = None,
thumb: Optional[Union[InputFile, str]] = None,
message_thread_id: Optional[bool] = None,
disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = None,
reply_to_message_id: Optional[int] = None,
@ -1033,6 +1061,7 @@ class Bot(ContextInstanceMixin["Bot"]):
Source: https://core.telegram.org/bots/api#sendvideonote
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param video_note: Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`. Sending video notes by a URL is currently unsupported
:param duration: Duration of sent video in seconds
:param length: Video width and height, i.e. diameter of the video message
@ -1047,6 +1076,7 @@ class Bot(ContextInstanceMixin["Bot"]):
"""
call = SendVideoNote(
chat_id=chat_id,
message_thread_id=message_thread_id,
video_note=video_note,
duration=duration,
length=length,
@ -1063,6 +1093,7 @@ class Bot(ContextInstanceMixin["Bot"]):
self,
chat_id: Union[int, str],
media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]],
message_thread_id: Optional[bool] = None,
disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = None,
reply_to_message_id: Optional[int] = None,
@ -1075,6 +1106,7 @@ class Bot(ContextInstanceMixin["Bot"]):
Source: https://core.telegram.org/bots/api#sendmediagroup
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param media: A JSON-serialized array describing messages to be sent, must include 2-10 items
: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
@ -1085,6 +1117,7 @@ class Bot(ContextInstanceMixin["Bot"]):
"""
call = SendMediaGroup(
chat_id=chat_id,
message_thread_id=message_thread_id,
media=media,
disable_notification=disable_notification,
protect_content=protect_content,
@ -1102,6 +1135,7 @@ class Bot(ContextInstanceMixin["Bot"]):
live_period: Optional[int] = None,
heading: Optional[int] = None,
proximity_alert_radius: Optional[int] = None,
message_thread_id: Optional[bool] = None,
disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = None,
reply_to_message_id: Optional[int] = None,
@ -1117,6 +1151,7 @@ class Bot(ContextInstanceMixin["Bot"]):
Source: https://core.telegram.org/bots/api#sendlocation
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param latitude: Latitude of the location
:param longitude: Longitude of the location
:param horizontal_accuracy: The radius of uncertainty for the location, measured in meters; 0-1500
@ -1133,6 +1168,7 @@ class Bot(ContextInstanceMixin["Bot"]):
"""
call = SendLocation(
chat_id=chat_id,
message_thread_id=message_thread_id,
latitude=latitude,
longitude=longitude,
horizontal_accuracy=horizontal_accuracy,
@ -1231,6 +1267,7 @@ class Bot(ContextInstanceMixin["Bot"]):
foursquare_type: Optional[str] = None,
google_place_id: Optional[str] = None,
google_place_type: Optional[str] = None,
message_thread_id: Optional[bool] = None,
disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = None,
reply_to_message_id: Optional[int] = None,
@ -1246,6 +1283,7 @@ class Bot(ContextInstanceMixin["Bot"]):
Source: https://core.telegram.org/bots/api#sendvenue
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param latitude: Latitude of the venue
:param longitude: Longitude of the venue
:param title: Name of the venue
@ -1264,6 +1302,7 @@ class Bot(ContextInstanceMixin["Bot"]):
"""
call = SendVenue(
chat_id=chat_id,
message_thread_id=message_thread_id,
latitude=latitude,
longitude=longitude,
title=title,
@ -1287,6 +1326,7 @@ class Bot(ContextInstanceMixin["Bot"]):
first_name: str,
last_name: Optional[str] = None,
vcard: Optional[str] = None,
message_thread_id: Optional[bool] = None,
disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = None,
reply_to_message_id: Optional[int] = None,
@ -1302,6 +1342,7 @@ class Bot(ContextInstanceMixin["Bot"]):
Source: https://core.telegram.org/bots/api#sendcontact
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param phone_number: Contact's phone number
:param first_name: Contact's first name
:param last_name: Contact's last name
@ -1316,6 +1357,7 @@ class Bot(ContextInstanceMixin["Bot"]):
"""
call = SendContact(
chat_id=chat_id,
message_thread_id=message_thread_id,
phone_number=phone_number,
first_name=first_name,
last_name=last_name,
@ -1343,6 +1385,7 @@ class Bot(ContextInstanceMixin["Bot"]):
open_period: Optional[int] = None,
close_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None,
is_closed: Optional[bool] = None,
message_thread_id: Optional[bool] = None,
disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = None,
reply_to_message_id: Optional[int] = None,
@ -1358,6 +1401,7 @@ class Bot(ContextInstanceMixin["Bot"]):
Source: https://core.telegram.org/bots/api#sendpoll
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param question: Poll question, 1-300 characters
:param options: A JSON-serialized list of answer options, 2-10 strings 1-100 characters each
:param is_anonymous: :code:`True`, if the poll needs to be anonymous, defaults to :code:`True`
@ -1380,6 +1424,7 @@ class Bot(ContextInstanceMixin["Bot"]):
"""
call = SendPoll(
chat_id=chat_id,
message_thread_id=message_thread_id,
question=question,
options=options,
is_anonymous=is_anonymous,
@ -1404,6 +1449,7 @@ class Bot(ContextInstanceMixin["Bot"]):
self,
chat_id: Union[int, str],
emoji: Optional[str] = None,
message_thread_id: Optional[bool] = None,
disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = None,
reply_to_message_id: Optional[int] = None,
@ -1419,6 +1465,7 @@ 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
@ -1430,6 +1477,7 @@ class Bot(ContextInstanceMixin["Bot"]):
"""
call = SendDice(
chat_id=chat_id,
message_thread_id=message_thread_id,
emoji=emoji,
disable_notification=disable_notification,
protect_content=protect_content,
@ -2657,6 +2705,7 @@ class Bot(ContextInstanceMixin["Bot"]):
self,
chat_id: Union[int, str],
sticker: Union[InputFile, str],
message_thread_id: Optional[bool] = None,
disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = None,
reply_to_message_id: Optional[int] = None,
@ -2672,6 +2721,7 @@ class Bot(ContextInstanceMixin["Bot"]):
Source: https://core.telegram.org/bots/api#sendsticker
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param sticker: Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`
:param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent message from forwarding and saving
@ -2683,6 +2733,7 @@ class Bot(ContextInstanceMixin["Bot"]):
"""
call = SendSticker(
chat_id=chat_id,
message_thread_id=message_thread_id,
sticker=sticker,
disable_notification=disable_notification,
protect_content=protect_content,
@ -2993,6 +3044,7 @@ class Bot(ContextInstanceMixin["Bot"]):
send_phone_number_to_provider: Optional[bool] = None,
send_email_to_provider: Optional[bool] = None,
is_flexible: Optional[bool] = None,
message_thread_id: Optional[bool] = None,
disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = None,
reply_to_message_id: Optional[int] = None,
@ -3006,6 +3058,7 @@ class Bot(ContextInstanceMixin["Bot"]):
Source: https://core.telegram.org/bots/api#sendinvoice
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param title: Product name, 1-32 characters
:param description: Product description, 1-255 characters
:param payload: Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.
@ -3037,6 +3090,7 @@ class Bot(ContextInstanceMixin["Bot"]):
"""
call = SendInvoice(
chat_id=chat_id,
message_thread_id=message_thread_id,
title=title,
description=description,
payload=payload,

View file

@ -28,6 +28,8 @@ class CopyMessage(TelegramMethod[MessageId]):
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"""
from_chat_id: Union[int, str]
"""Unique identifier for the chat where the original message was sent (or channel username in the format :code:`@channelusername`)"""
message_id: int

View file

@ -20,6 +20,8 @@ class ForwardMessage(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"""
from_chat_id: Union[int, str]
"""Unique identifier for the chat where the original message was sent (or channel username in the format :code:`@channelusername`)"""
message_id: int

View file

@ -29,6 +29,8 @@ class SendAnimation(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"""
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>`"""
duration: Optional[int] = None

View file

@ -30,6 +30,8 @@ class SendAudio(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"""
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>`"""
caption: Optional[str] = None

View file

@ -26,6 +26,8 @@ class SendContact(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"""
phone_number: str
"""Contact's phone number"""
first_name: str

View file

@ -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

View file

@ -29,6 +29,8 @@ class SendDocument(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"""
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>`"""
thumb: Optional[Union[InputFile, str]] = None

View file

@ -20,6 +20,8 @@ class SendGame(TelegramMethod[Message]):
chat_id: int
"""Unique identifier for the target chat"""
message_thread_id: Optional[int] = None
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
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>`_."""
disable_notification: Optional[bool] = None

View file

@ -20,6 +20,8 @@ class SendInvoice(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"""
title: str
"""Product name, 1-32 characters"""
description: str

View file

@ -26,6 +26,8 @@ class SendLocation(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"""
latitude: float
"""Latitude of the location"""
longitude: float

View file

@ -27,6 +27,8 @@ class SendMediaGroup(TelegramMethod[List[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"""
media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]]
"""A JSON-serialized array describing messages to be sent, must include 2-10 items"""
disable_notification: Optional[bool] = None

View file

@ -28,6 +28,8 @@ class SendMessage(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"""
text: str
"""Text of the message to be sent, 1-4096 characters after entities parsing"""
parse_mode: Optional[str] = UNSET

View file

@ -29,6 +29,8 @@ class SendPhoto(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"""
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>`"""
caption: Optional[str] = None

View file

@ -29,6 +29,8 @@ class SendPoll(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"""
question: str
"""Poll question, 1-300 characters"""
options: List[str]

View file

@ -27,6 +27,8 @@ class SendSticker(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"""
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>`"""
disable_notification: Optional[bool] = None

View file

@ -26,6 +26,8 @@ class SendVenue(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"""
latitude: float
"""Latitude of the venue"""
longitude: float

View file

@ -29,6 +29,8 @@ class SendVideo(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"""
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>`"""
duration: Optional[int] = None

View file

@ -27,6 +27,8 @@ class SendVideoNote(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"""
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"""
duration: Optional[int] = None

View file

@ -29,6 +29,8 @@ class SendVoice(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"""
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>`"""
caption: Optional[str] = None

View file

@ -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. True, if the supergroup chat is a forum (has topics enabled)"""
photo: Optional[ChatPhoto] = None
"""*Optional*. Chat photo. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
active_usernames: Union[list, str] = None
"""Optional. If non-empty, the list of all active chat 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

View file

@ -90,6 +90,8 @@ class Message(TelegramObject):
message_id: int
"""Unique message identifier inside this chat"""
message_thread_id: Optional[int] = None
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
date: datetime.datetime
"""Date the message was sent in Unix time"""
chat: Chat
@ -110,6 +112,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. 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
@ -333,6 +337,7 @@ class Message(TelegramObject):
return SendAnimation(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
animation=animation,
duration=duration,
width=width,
@ -378,6 +383,7 @@ class Message(TelegramObject):
return SendAnimation(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
animation=animation,
duration=duration,
width=width,
@ -424,6 +430,7 @@ class Message(TelegramObject):
return SendAudio(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
audio=audio,
caption=caption,
parse_mode=parse_mode,
@ -469,6 +476,7 @@ class Message(TelegramObject):
return SendAudio(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
audio=audio,
caption=caption,
parse_mode=parse_mode,
@ -509,6 +517,7 @@ class Message(TelegramObject):
return SendContact(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
phone_number=phone_number,
first_name=first_name,
last_name=last_name,
@ -545,6 +554,7 @@ class Message(TelegramObject):
return SendContact(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
phone_number=phone_number,
first_name=first_name,
last_name=last_name,
@ -582,6 +592,7 @@ class Message(TelegramObject):
return SendDocument(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
document=document,
thumb=thumb,
caption=caption,
@ -618,6 +629,7 @@ class Message(TelegramObject):
return SendDocument(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
document=document,
thumb=thumb,
caption=caption,
@ -647,6 +659,7 @@ class Message(TelegramObject):
return SendGame(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
game_short_name=game_short_name,
disable_notification=disable_notification,
reply_to_message_id=self.message_id,
@ -672,6 +685,7 @@ class Message(TelegramObject):
return SendGame(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
game_short_name=game_short_name,
disable_notification=disable_notification,
reply_to_message_id=None,
@ -740,6 +754,7 @@ class Message(TelegramObject):
return SendInvoice(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
title=title,
description=description,
payload=payload,
@ -828,6 +843,7 @@ class Message(TelegramObject):
return SendInvoice(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
title=title,
description=description,
payload=payload,
@ -881,6 +897,7 @@ class Message(TelegramObject):
return SendLocation(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
latitude=latitude,
longitude=longitude,
live_period=live_period,
@ -914,6 +931,7 @@ class Message(TelegramObject):
return SendLocation(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
latitude=latitude,
longitude=longitude,
live_period=live_period,
@ -940,6 +958,7 @@ class Message(TelegramObject):
return SendMediaGroup(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
media=media,
disable_notification=disable_notification,
reply_to_message_id=self.message_id,
@ -962,6 +981,7 @@ class Message(TelegramObject):
return SendMediaGroup(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
media=media,
disable_notification=disable_notification,
reply_to_message_id=None,
@ -993,6 +1013,7 @@ class Message(TelegramObject):
return SendMessage(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
text=text,
parse_mode=parse_mode,
disable_web_page_preview=disable_web_page_preview,
@ -1026,6 +1047,7 @@ class Message(TelegramObject):
return SendMessage(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
text=text,
parse_mode=parse_mode,
disable_web_page_preview=disable_web_page_preview,
@ -1060,6 +1082,7 @@ class Message(TelegramObject):
return SendPhoto(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
photo=photo,
caption=caption,
parse_mode=parse_mode,
@ -1093,6 +1116,7 @@ class Message(TelegramObject):
return SendPhoto(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
photo=photo,
caption=caption,
parse_mode=parse_mode,
@ -1143,6 +1167,7 @@ class Message(TelegramObject):
return SendPoll(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
question=question,
options=options,
is_anonymous=is_anonymous,
@ -1200,6 +1225,7 @@ class Message(TelegramObject):
return SendPoll(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
question=question,
options=options,
is_anonymous=is_anonymous,
@ -1238,6 +1264,7 @@ class Message(TelegramObject):
return SendDice(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
emoji=emoji,
disable_notification=disable_notification,
reply_to_message_id=self.message_id,
@ -1265,6 +1292,7 @@ class Message(TelegramObject):
return SendDice(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
emoji=emoji,
disable_notification=disable_notification,
reply_to_message_id=None,
@ -1293,6 +1321,7 @@ class Message(TelegramObject):
return SendSticker(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
sticker=sticker,
disable_notification=disable_notification,
reply_to_message_id=self.message_id,
@ -1320,6 +1349,7 @@ class Message(TelegramObject):
return SendSticker(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
sticker=sticker,
disable_notification=disable_notification,
reply_to_message_id=None,
@ -1358,6 +1388,7 @@ class Message(TelegramObject):
return SendVenue(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
latitude=latitude,
longitude=longitude,
title=title,
@ -1400,6 +1431,7 @@ class Message(TelegramObject):
return SendVenue(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
latitude=latitude,
longitude=longitude,
title=title,
@ -1447,6 +1479,7 @@ class Message(TelegramObject):
return SendVideo(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
video=video,
duration=duration,
width=width,
@ -1495,6 +1528,7 @@ class Message(TelegramObject):
return SendVideo(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
video=video,
duration=duration,
width=width,
@ -1536,6 +1570,7 @@ class Message(TelegramObject):
return SendVideoNote(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
video_note=video_note,
duration=duration,
length=length,
@ -1572,6 +1607,7 @@ class Message(TelegramObject):
return SendVideoNote(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
video_note=video_note,
duration=duration,
length=length,
@ -1609,6 +1645,7 @@ class Message(TelegramObject):
return SendVoice(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
voice=voice,
caption=caption,
parse_mode=parse_mode,
@ -1645,6 +1682,7 @@ class Message(TelegramObject):
return SendVoice(
chat_id=self.chat.id,
message_thread_id=message.message_thread_id,
voice=voice,
caption=caption,
parse_mode=parse_mode,
@ -1657,6 +1695,7 @@ class Message(TelegramObject):
def send_copy(
self: Message,
chat_id: Union[str, int],
message_thread_id: Optional[bool] = None,
disable_notification: Optional[bool] = None,
reply_to_message_id: Optional[int] = None,
reply_markup: Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, None] = None,
@ -1688,6 +1727,7 @@ class Message(TelegramObject):
historically implemented before the similar method is added to API
:param chat_id:
:param message_thread_id:
:param disable_notification:
:param reply_to_message_id:
:param reply_markup:
@ -1712,6 +1752,7 @@ class Message(TelegramObject):
kwargs = {
"chat_id": chat_id,
"message_thread_id": message_thread_id,
"reply_markup": reply_markup or self.reply_markup,
"disable_notification": disable_notification,
"reply_to_message_id": reply_to_message_id,
@ -1789,6 +1830,7 @@ class Message(TelegramObject):
def copy_to(
self,
chat_id: Union[int, str],
message_thread_id=message.message_thread_id,
caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET,
caption_entities: Optional[List[MessageEntity]] = None,
@ -1803,6 +1845,7 @@ class Message(TelegramObject):
Copy message
:param chat_id:
:param message_thread_id:
:param caption:
:param parse_mode:
:param caption_entities:
@ -1816,6 +1859,7 @@ class Message(TelegramObject):
return CopyMessage(
chat_id=chat_id,
message_thread_id=message.message_thread_id,
from_chat_id=self.chat.id,
message_id=self.message_id,
caption=caption,
@ -1857,6 +1901,7 @@ class Message(TelegramObject):
return ForwardMessage(
chat_id=chat_id,
message_thread_id=message.message_thread_id,
from_chat_id=self.chat.id,
message_id=self.message_id,
disable_notification=disable_notification,