mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Added all necessary parameters
Added the parameter message_thread_id to the methods sendMessage, sendPhoto, sendVideo, sendAnimation, sendAudio, sendDocument, sendSticker, sendVideoNote, sendVoice, sendLocation, sendVenue, sendContact, sendPoll, sendDice, sendInvoice, sendGame, sendMediaGroup, copyMessage, forwardMessage to support sending of messages to a forum topic.
This commit is contained in:
@@ -2340,7 +2340,8 @@ class AsyncTeleBot:
|
||||
reply_to_message_id: Optional[int]=None,
|
||||
allow_sending_without_reply: Optional[bool]=None,
|
||||
reply_markup: Optional[REPLY_MARKUP_TYPES]=None,
|
||||
timeout: Optional[int]=None) -> types.Message:
|
||||
timeout: Optional[int]=None,
|
||||
message_thread_id: Optional[int]=None) -> types.Message:
|
||||
"""
|
||||
Use this method to send text messages.
|
||||
|
||||
@@ -2384,6 +2385,9 @@ class AsyncTeleBot:
|
||||
:param timeout: Timeout in seconds for the request.
|
||||
:type timeout: :obj:`int`
|
||||
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
:type message_thread_id: :obj:`int`
|
||||
|
||||
:return: On success, the sent Message is returned.
|
||||
:rtype: :class:`telebot.types.Message`
|
||||
"""
|
||||
@@ -2397,13 +2401,14 @@ class AsyncTeleBot:
|
||||
await asyncio_helper.send_message(
|
||||
self.token, chat_id, text, disable_web_page_preview, reply_to_message_id,
|
||||
reply_markup, parse_mode, disable_notification, timeout,
|
||||
entities, allow_sending_without_reply, protect_content))
|
||||
entities, allow_sending_without_reply, protect_content, message_thread_id))
|
||||
|
||||
async def forward_message(
|
||||
self, chat_id: Union[int, str], from_chat_id: Union[int, str],
|
||||
message_id: int, disable_notification: Optional[bool]=None,
|
||||
protect_content: Optional[bool]=None,
|
||||
timeout: Optional[int]=None) -> types.Message:
|
||||
timeout: Optional[int]=None,
|
||||
message_thread_id: Optional[int]=None) -> types.Message:
|
||||
"""
|
||||
Use this method to forward messages of any kind.
|
||||
|
||||
@@ -2427,6 +2432,9 @@ class AsyncTeleBot:
|
||||
:param timeout: Timeout in seconds for the request.
|
||||
:type timeout: :obj:`int`
|
||||
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
:type message_thread_id: :obj:`int`
|
||||
|
||||
:return: On success, the sent Message is returned.
|
||||
:rtype: :class:`telebot.types.Message`
|
||||
"""
|
||||
@@ -2434,7 +2442,8 @@ class AsyncTeleBot:
|
||||
protect_content = self.protect_content if (protect_content is None) else protect_content
|
||||
|
||||
return types.Message.de_json(
|
||||
await asyncio_helper.forward_message(self.token, chat_id, from_chat_id, message_id, disable_notification, timeout, protect_content))
|
||||
await asyncio_helper.forward_message(self.token, chat_id, from_chat_id, message_id, disable_notification, timeout, protect_content,
|
||||
message_thread_id))
|
||||
|
||||
async def copy_message(
|
||||
self, chat_id: Union[int, str],
|
||||
@@ -2448,7 +2457,8 @@ class AsyncTeleBot:
|
||||
reply_to_message_id: Optional[int]=None,
|
||||
allow_sending_without_reply: Optional[bool]=None,
|
||||
reply_markup: Optional[REPLY_MARKUP_TYPES]=None,
|
||||
timeout: Optional[int]=None) -> types.MessageID:
|
||||
timeout: Optional[int]=None,
|
||||
message_thread_id: Optional[int]=None) -> types.MessageID:
|
||||
"""
|
||||
Use this method to copy messages of any kind.
|
||||
|
||||
@@ -2490,6 +2500,9 @@ class AsyncTeleBot:
|
||||
|
||||
:param timeout: Timeout in seconds for the request.
|
||||
:type timeout: :obj:`int`
|
||||
|
||||
:param message_thread_id: Identifier of a message thread, in which the message will be sent
|
||||
:type message_thread_id: :obj:`int`
|
||||
|
||||
:return: On success, the sent Message is returned.
|
||||
:rtype: :class:`telebot.types.Message`
|
||||
@@ -2502,7 +2515,7 @@ class AsyncTeleBot:
|
||||
return types.MessageID.de_json(
|
||||
await asyncio_helper.copy_message(self.token, chat_id, from_chat_id, message_id, caption, parse_mode, caption_entities,
|
||||
disable_notification, reply_to_message_id, allow_sending_without_reply, reply_markup,
|
||||
timeout, protect_content))
|
||||
timeout, protect_content, message_thread_id))
|
||||
|
||||
async def delete_message(self, chat_id: Union[int, str], message_id: int,
|
||||
timeout: Optional[int]=None) -> bool:
|
||||
@@ -2540,7 +2553,8 @@ class AsyncTeleBot:
|
||||
reply_markup: Optional[REPLY_MARKUP_TYPES]=None,
|
||||
timeout: Optional[int]=None,
|
||||
allow_sending_without_reply: Optional[bool]=None,
|
||||
protect_content: Optional[bool]=None) -> types.Message:
|
||||
protect_content: Optional[bool]=None,
|
||||
message_thread_id: Optional[int]=None) -> types.Message:
|
||||
"""
|
||||
Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.
|
||||
|
||||
@@ -2573,6 +2587,9 @@ class AsyncTeleBot:
|
||||
:param protect_content: Protects the contents of the sent message from forwarding
|
||||
:type protect_content: :obj:`bool`
|
||||
|
||||
:param message_thread_id: The identifier of a message thread, unique within the chat to which the message with the thread identifier belongs
|
||||
:type message_thread_id: :obj:`int`
|
||||
|
||||
:return: On success, the sent Message is returned.
|
||||
:rtype: :class:`telebot.types.Message`
|
||||
"""
|
||||
@@ -2583,7 +2600,7 @@ class AsyncTeleBot:
|
||||
return types.Message.de_json(
|
||||
await asyncio_helper.send_dice(
|
||||
self.token, chat_id, emoji, disable_notification, reply_to_message_id,
|
||||
reply_markup, timeout, allow_sending_without_reply, protect_content)
|
||||
reply_markup, timeout, allow_sending_without_reply, protect_content, message_thread_id)
|
||||
)
|
||||
|
||||
async def send_photo(
|
||||
@@ -2595,7 +2612,8 @@ class AsyncTeleBot:
|
||||
reply_to_message_id: Optional[int]=None,
|
||||
allow_sending_without_reply: Optional[bool]=None,
|
||||
reply_markup: Optional[REPLY_MARKUP_TYPES]=None,
|
||||
timeout: Optional[int]=None,) -> types.Message:
|
||||
timeout: Optional[int]=None,
|
||||
message_thread_id: Optional[int]=None) -> types.Message:
|
||||
"""
|
||||
Use this method to send photos. On success, the sent Message is returned.
|
||||
|
||||
@@ -2637,6 +2655,9 @@ class AsyncTeleBot:
|
||||
|
||||
:param timeout: Timeout in seconds for the request.
|
||||
:type timeout: :obj:`int`
|
||||
|
||||
:param message_thread_id: Identifier of a message thread, in which the message will be sent
|
||||
:type message_thread_id: :obj:`int`
|
||||
|
||||
:return: On success, the sent Message is returned.
|
||||
:rtype: :class:`telebot.types.Message`
|
||||
@@ -2650,7 +2671,7 @@ class AsyncTeleBot:
|
||||
await asyncio_helper.send_photo(
|
||||
self.token, chat_id, photo, caption, reply_to_message_id, reply_markup,
|
||||
parse_mode, disable_notification, timeout, caption_entities,
|
||||
allow_sending_without_reply, protect_content))
|
||||
allow_sending_without_reply, protect_content, message_thread_id))
|
||||
|
||||
async def send_audio(
|
||||
self, chat_id: Union[int, str], audio: Union[Any, str],
|
||||
@@ -2664,7 +2685,8 @@ class AsyncTeleBot:
|
||||
thumb: Optional[Union[Any, str]]=None,
|
||||
caption_entities: Optional[List[types.MessageEntity]]=None,
|
||||
allow_sending_without_reply: Optional[bool]=None,
|
||||
protect_content: Optional[bool]=None) -> types.Message:
|
||||
protect_content: Optional[bool]=None,
|
||||
message_thread_id: Optional[int]=None) -> types.Message:
|
||||
"""
|
||||
Use this method to send audio files, if you want Telegram clients to display them in the music player.
|
||||
Your audio must be in the .MP3 or .M4A format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size,
|
||||
@@ -2725,6 +2747,9 @@ class AsyncTeleBot:
|
||||
:param protect_content: Protects the contents of the sent message from forwarding and saving
|
||||
:type protect_content: :obj:`bool`
|
||||
|
||||
:param message_thread_id: Identifier of a message thread, in which the message will be sent
|
||||
:type message_thread_id: :obj:`int`
|
||||
|
||||
:return: On success, the sent Message is returned.
|
||||
:rtype: :class:`telebot.types.Message`
|
||||
"""
|
||||
@@ -2737,7 +2762,7 @@ class AsyncTeleBot:
|
||||
await asyncio_helper.send_audio(
|
||||
self.token, chat_id, audio, caption, duration, performer, title, reply_to_message_id,
|
||||
reply_markup, parse_mode, disable_notification, timeout, thumb,
|
||||
caption_entities, allow_sending_without_reply, protect_content))
|
||||
caption_entities, allow_sending_without_reply, protect_content, message_thread_id))
|
||||
|
||||
async def send_voice(
|
||||
self, chat_id: Union[int, str], voice: Union[Any, str],
|
||||
@@ -2749,7 +2774,8 @@ class AsyncTeleBot:
|
||||
timeout: Optional[int]=None,
|
||||
caption_entities: Optional[List[types.MessageEntity]]=None,
|
||||
allow_sending_without_reply: Optional[bool]=None,
|
||||
protect_content: Optional[bool]=None) -> types.Message:
|
||||
protect_content: Optional[bool]=None,
|
||||
message_thread_id: Optional[int]=None) -> types.Message:
|
||||
"""
|
||||
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message.
|
||||
For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document).
|
||||
@@ -2796,6 +2822,9 @@ class AsyncTeleBot:
|
||||
:param protect_content: Protects the contents of the sent message from forwarding and saving
|
||||
:type protect_content: :obj:`bool`
|
||||
|
||||
:param message_thread_id: Identifier of a message thread, in which the message will be sent
|
||||
:type message_thread_id: :obj:`int`
|
||||
|
||||
:return: On success, the sent Message is returned.
|
||||
"""
|
||||
parse_mode = self.parse_mode if (parse_mode is None) else parse_mode
|
||||
@@ -2807,7 +2836,7 @@ class AsyncTeleBot:
|
||||
await asyncio_helper.send_voice(
|
||||
self.token, chat_id, voice, caption, duration, reply_to_message_id, reply_markup,
|
||||
parse_mode, disable_notification, timeout, caption_entities,
|
||||
allow_sending_without_reply, protect_content))
|
||||
allow_sending_without_reply, protect_content, message_thread_id))
|
||||
|
||||
async def send_document(
|
||||
self, chat_id: Union[int, str], document: Union[Any, str],
|
||||
@@ -2823,7 +2852,8 @@ class AsyncTeleBot:
|
||||
visible_file_name: Optional[str]=None,
|
||||
disable_content_type_detection: Optional[bool]=None,
|
||||
data: Optional[Union[Any, str]]=None,
|
||||
protect_content: Optional[bool]=None) -> types.Message:
|
||||
protect_content: Optional[bool]=None,
|
||||
message_thread_id: Optional[int]=None) -> types.Message:
|
||||
"""
|
||||
Use this method to send general files.
|
||||
|
||||
@@ -2877,6 +2907,9 @@ class AsyncTeleBot:
|
||||
:param protect_content: Protects the contents of the sent message from forwarding and saving
|
||||
:type protect_content: :obj:`bool`
|
||||
|
||||
:param message_thread_id: Identifier of a message thread, in which the message will be sent
|
||||
:type message_thread_id: :obj:`int`
|
||||
|
||||
:return: On success, the sent Message is returned.
|
||||
:rtype: :class:`telebot.types.Message`
|
||||
"""
|
||||
@@ -2895,7 +2928,8 @@ class AsyncTeleBot:
|
||||
reply_to_message_id = reply_to_message_id, reply_markup = reply_markup, parse_mode = parse_mode,
|
||||
disable_notification = disable_notification, timeout = timeout, caption = caption, thumb = thumb,
|
||||
caption_entities = caption_entities, allow_sending_without_reply = allow_sending_without_reply,
|
||||
disable_content_type_detection = disable_content_type_detection, visible_file_name = visible_file_name, protect_content = protect_content))
|
||||
disable_content_type_detection = disable_content_type_detection, visible_file_name = visible_file_name, protect_content = protect_content,
|
||||
message_thread_id = message_thread_id))
|
||||
|
||||
async def send_sticker(
|
||||
self, chat_id: Union[int, str], sticker: Union[Any, str],
|
||||
@@ -2905,7 +2939,8 @@ class AsyncTeleBot:
|
||||
timeout: Optional[int]=None,
|
||||
allow_sending_without_reply: Optional[bool]=None,
|
||||
protect_content: Optional[bool]=None,
|
||||
data: Union[Any, str]=None) -> types.Message:
|
||||
data: Union[Any, str]=None,
|
||||
message_thread_id: Optional[int]=None) -> types.Message:
|
||||
"""
|
||||
Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers.
|
||||
On success, the sent Message is returned.
|
||||
@@ -2942,6 +2977,9 @@ class AsyncTeleBot:
|
||||
:param data: function typo miss compatibility: do not use it
|
||||
:type data: :obj:`str`
|
||||
|
||||
:param message_thread_id: Identifier of a message thread, in which the message will be sent
|
||||
:type message_thread_id: :obj:`int`
|
||||
|
||||
:return: On success, the sent Message is returned.
|
||||
:rtype: :class:`telebot.types.Message`
|
||||
"""
|
||||
@@ -2959,7 +2997,8 @@ class AsyncTeleBot:
|
||||
self.token, chat_id, sticker, 'sticker',
|
||||
reply_to_message_id=reply_to_message_id, reply_markup=reply_markup,
|
||||
disable_notification=disable_notification, timeout=timeout,
|
||||
allow_sending_without_reply=allow_sending_without_reply, protect_content=protect_content))
|
||||
allow_sending_without_reply=allow_sending_without_reply, protect_content=protect_content,
|
||||
message_thread_id=message_thread_id))
|
||||
|
||||
async def send_video(
|
||||
self, chat_id: Union[int, str], video: Union[Any, str],
|
||||
@@ -2977,7 +3016,8 @@ class AsyncTeleBot:
|
||||
allow_sending_without_reply: Optional[bool]=None,
|
||||
reply_markup: Optional[REPLY_MARKUP_TYPES]=None,
|
||||
timeout: Optional[int]=None,
|
||||
data: Optional[Union[Any, str]]=None) -> types.Message:
|
||||
data: Optional[Union[Any, str]]=None,
|
||||
message_thread_id: Optional[int]=None) -> types.Message:
|
||||
"""
|
||||
Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document).
|
||||
|
||||
@@ -3036,6 +3076,9 @@ class AsyncTeleBot:
|
||||
:param data: function typo miss compatibility: do not use it
|
||||
:type data: :obj:`str`
|
||||
|
||||
:param message_thread_id: Identifier of a message thread, in which the video will be sent
|
||||
:type message_thread_id: :obj:`int`
|
||||
|
||||
:return: On success, the sent Message is returned.
|
||||
:rtype: :class:`telebot.types.Message`
|
||||
"""
|
||||
@@ -3053,7 +3096,7 @@ class AsyncTeleBot:
|
||||
await asyncio_helper.send_video(
|
||||
self.token, chat_id, video, duration, caption, reply_to_message_id, reply_markup,
|
||||
parse_mode, supports_streaming, disable_notification, timeout, thumb, width, height,
|
||||
caption_entities, allow_sending_without_reply, protect_content))
|
||||
caption_entities, allow_sending_without_reply, protect_content, message_thread_id))
|
||||
|
||||
async def send_animation(
|
||||
self, chat_id: Union[int, str], animation: Union[Any, str],
|
||||
@@ -3069,7 +3112,8 @@ class AsyncTeleBot:
|
||||
reply_to_message_id: Optional[int]=None,
|
||||
allow_sending_without_reply: Optional[bool]=None,
|
||||
reply_markup: Optional[REPLY_MARKUP_TYPES]=None,
|
||||
timeout: Optional[int]=None, ) -> types.Message:
|
||||
timeout: Optional[int]=None,
|
||||
message_thread_id: Optional[int]=None) -> types.Message:
|
||||
"""
|
||||
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound).
|
||||
On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
|
||||
@@ -3127,6 +3171,9 @@ class AsyncTeleBot:
|
||||
:param allow_sending_without_reply: Pass True, if the message should be sent even if the specified replied-to message is not found
|
||||
:type allow_sending_without_reply: :obj:`bool`
|
||||
|
||||
:param message_thread_id: Identifier of a message thread, in which the video will be sent
|
||||
:type message_thread_id: :obj:`int`
|
||||
|
||||
:return: On success, the sent Message is returned.
|
||||
:rtype: :class:`telebot.types.Message`
|
||||
"""
|
||||
@@ -3139,7 +3186,7 @@ class AsyncTeleBot:
|
||||
await asyncio_helper.send_animation(
|
||||
self.token, chat_id, animation, duration, caption, reply_to_message_id,
|
||||
reply_markup, parse_mode, disable_notification, timeout, thumb,
|
||||
caption_entities, allow_sending_without_reply, width, height, protect_content))
|
||||
caption_entities, allow_sending_without_reply, width, height, protect_content, message_thread_id))
|
||||
|
||||
async def send_video_note(
|
||||
self, chat_id: Union[int, str], data: Union[Any, str],
|
||||
@@ -3151,7 +3198,8 @@ class AsyncTeleBot:
|
||||
timeout: Optional[int]=None,
|
||||
thumb: Optional[Union[Any, str]]=None,
|
||||
allow_sending_without_reply: Optional[bool]=None,
|
||||
protect_content: Optional[bool]=None) -> types.Message:
|
||||
protect_content: Optional[bool]=None,
|
||||
message_thread_id: Optional[int]=None) -> types.Message:
|
||||
"""
|
||||
As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long.
|
||||
Use this method to send video messages. On success, the sent Message is returned.
|
||||
@@ -3197,6 +3245,9 @@ class AsyncTeleBot:
|
||||
:param protect_content: Protects the contents of the sent message from forwarding and saving
|
||||
:type protect_content: :obj:`bool`
|
||||
|
||||
:param message_thread_id: Identifier of a message thread, in which the video note will be sent
|
||||
:type message_thread_id: :obj:`int`
|
||||
|
||||
:return: On success, the sent Message is returned.
|
||||
:rtype: :class:`telebot.types.Message`
|
||||
"""
|
||||
@@ -3207,7 +3258,7 @@ class AsyncTeleBot:
|
||||
return types.Message.de_json(
|
||||
await asyncio_helper.send_video_note(
|
||||
self.token, chat_id, data, duration, length, reply_to_message_id, reply_markup,
|
||||
disable_notification, timeout, thumb, allow_sending_without_reply, protect_content))
|
||||
disable_notification, timeout, thumb, allow_sending_without_reply, protect_content, message_thread_id))
|
||||
|
||||
async def send_media_group(
|
||||
self, chat_id: Union[int, str],
|
||||
@@ -3218,7 +3269,8 @@ class AsyncTeleBot:
|
||||
protect_content: Optional[bool]=None,
|
||||
reply_to_message_id: Optional[int]=None,
|
||||
timeout: Optional[int]=None,
|
||||
allow_sending_without_reply: Optional[bool]=None) -> List[types.Message]:
|
||||
allow_sending_without_reply: Optional[bool]=None,
|
||||
message_thread_id: Optional[int]=None) -> List[types.Message]:
|
||||
"""
|
||||
Use this method to send a group of photos, videos, documents or audios as an album. Documents and audio files
|
||||
can be only grouped in an album with messages of the same type. On success, an array of Messages that were sent is returned.
|
||||
@@ -3246,6 +3298,9 @@ class AsyncTeleBot:
|
||||
:param allow_sending_without_reply: Pass True, if the message should be sent even if the specified replied-to message is not found
|
||||
:type allow_sending_without_reply: :obj:`bool`
|
||||
|
||||
:param message_thread_id: Identifier of a message thread, in which the messages will be sent
|
||||
:type message_thread_id: :obj:`int`
|
||||
|
||||
:return: On success, an array of Messages that were sent is returned.
|
||||
:rtype: List[types.Message]
|
||||
"""
|
||||
@@ -3255,7 +3310,7 @@ class AsyncTeleBot:
|
||||
|
||||
result = await asyncio_helper.send_media_group(
|
||||
self.token, chat_id, media, disable_notification, reply_to_message_id, timeout,
|
||||
allow_sending_without_reply, protect_content)
|
||||
allow_sending_without_reply, protect_content, message_thread_id)
|
||||
return [types.Message.de_json(msg) for msg in result]
|
||||
|
||||
async def send_location(
|
||||
@@ -3270,7 +3325,8 @@ class AsyncTeleBot:
|
||||
heading: Optional[int]=None,
|
||||
proximity_alert_radius: Optional[int]=None,
|
||||
allow_sending_without_reply: Optional[bool]=None,
|
||||
protect_content: Optional[bool]=None) -> types.Message:
|
||||
protect_content: Optional[bool]=None,
|
||||
message_thread_id: Optional[int]=None) -> types.Message:
|
||||
"""
|
||||
Use this method to send point on the map. On success, the sent Message is returned.
|
||||
|
||||
@@ -3317,6 +3373,9 @@ class AsyncTeleBot:
|
||||
:param protect_content: Protects the contents of the sent message from forwarding and saving
|
||||
:type protect_content: :obj:`bool`
|
||||
|
||||
:param message_thread_id: Identifier of a message thread, in which the message will be sent
|
||||
:type message_thread_id: :obj:`int`
|
||||
|
||||
:return: On success, the sent Message is returned.
|
||||
:rtype: :class:`telebot.types.Message`
|
||||
"""
|
||||
@@ -3329,7 +3388,7 @@ class AsyncTeleBot:
|
||||
self.token, chat_id, latitude, longitude, live_period,
|
||||
reply_to_message_id, reply_markup, disable_notification, timeout,
|
||||
horizontal_accuracy, heading, proximity_alert_radius,
|
||||
allow_sending_without_reply, protect_content))
|
||||
allow_sending_without_reply, protect_content, message_thread_id))
|
||||
|
||||
async def edit_message_live_location(
|
||||
self, latitude: float, longitude: float,
|
||||
@@ -3436,7 +3495,8 @@ class AsyncTeleBot:
|
||||
allow_sending_without_reply: Optional[bool]=None,
|
||||
google_place_id: Optional[str]=None,
|
||||
google_place_type: Optional[str]=None,
|
||||
protect_content: Optional[bool]=None) -> types.Message:
|
||||
protect_content: Optional[bool]=None,
|
||||
message_thread_id: Optional[int]=None) -> types.Message:
|
||||
"""
|
||||
Use this method to send information about a venue. On success, the sent Message is returned.
|
||||
|
||||
@@ -3491,6 +3551,9 @@ class AsyncTeleBot:
|
||||
:param protect_content: Protects the contents of the sent message from forwarding and saving
|
||||
:type protect_content: :obj:`bool`
|
||||
|
||||
:param message_thread_id: The thread to which the message will be sent
|
||||
:type message_thread_id: :obj:`int`
|
||||
|
||||
:return: On success, the sent Message is returned.
|
||||
:rtype: :class:`telebot.types.Message`
|
||||
"""
|
||||
@@ -3502,7 +3565,7 @@ class AsyncTeleBot:
|
||||
await asyncio_helper.send_venue(
|
||||
self.token, chat_id, latitude, longitude, title, address, foursquare_id, foursquare_type,
|
||||
disable_notification, reply_to_message_id, reply_markup, timeout,
|
||||
allow_sending_without_reply, google_place_id, google_place_type, protect_content)
|
||||
allow_sending_without_reply, google_place_id, google_place_type, protect_content, message_thread_id)
|
||||
)
|
||||
|
||||
async def send_contact(
|
||||
@@ -3514,7 +3577,8 @@ class AsyncTeleBot:
|
||||
reply_markup: Optional[REPLY_MARKUP_TYPES]=None,
|
||||
timeout: Optional[int]=None,
|
||||
allow_sending_without_reply: Optional[bool]=None,
|
||||
protect_content: Optional[bool]=None) -> types.Message:
|
||||
protect_content: Optional[bool]=None,
|
||||
message_thread_id: Optional[int]=None) -> types.Message:
|
||||
"""
|
||||
Use this method to send phone contacts. On success, the sent Message is returned.
|
||||
|
||||
@@ -3556,6 +3620,9 @@ class AsyncTeleBot:
|
||||
:param protect_content: Protects the contents of the sent message from forwarding and saving
|
||||
:type protect_content: :obj:`bool`
|
||||
|
||||
:param message_thread_id: The thread to which the message will be sent
|
||||
:type message_thread_id: :obj:`int`
|
||||
|
||||
:return: On success, the sent Message is returned.
|
||||
:rtype: :class:`telebot.types.Message`
|
||||
"""
|
||||
@@ -3567,7 +3634,7 @@ class AsyncTeleBot:
|
||||
await asyncio_helper.send_contact(
|
||||
self.token, chat_id, phone_number, first_name, last_name, vcard,
|
||||
disable_notification, reply_to_message_id, reply_markup, timeout,
|
||||
allow_sending_without_reply, protect_content)
|
||||
allow_sending_without_reply, protect_content, message_thread_id)
|
||||
)
|
||||
|
||||
async def send_chat_action(
|
||||
@@ -4491,7 +4558,8 @@ class AsyncTeleBot:
|
||||
reply_markup: Optional[REPLY_MARKUP_TYPES]=None,
|
||||
timeout: Optional[int]=None,
|
||||
allow_sending_without_reply: Optional[bool]=None,
|
||||
protect_content: Optional[bool]=None) -> types.Message:
|
||||
protect_content: Optional[bool]=None,
|
||||
message_thread_id: Optional[int]=None) -> types.Message:
|
||||
"""
|
||||
Used to send the game.
|
||||
|
||||
@@ -4521,6 +4589,9 @@ class AsyncTeleBot:
|
||||
:param protect_content: Pass True, if content of the message needs to be protected from being viewed by the bot.
|
||||
:type protect_content: :obj:`bool`
|
||||
|
||||
:param message_thread_id: Identifier of the thread to which the message will be sent.
|
||||
:type message_thread_id: :obj:`int`
|
||||
|
||||
:return: On success, the sent Message is returned.
|
||||
:rtype: :obj:`types.Message`
|
||||
"""
|
||||
@@ -4531,7 +4602,7 @@ class AsyncTeleBot:
|
||||
result = await asyncio_helper.send_game(
|
||||
self.token, chat_id, game_short_name, disable_notification,
|
||||
reply_to_message_id, reply_markup, timeout,
|
||||
allow_sending_without_reply, protect_content)
|
||||
allow_sending_without_reply, protect_content, message_thread_id)
|
||||
return types.Message.de_json(result)
|
||||
|
||||
async def set_game_score(
|
||||
@@ -4627,7 +4698,8 @@ class AsyncTeleBot:
|
||||
allow_sending_without_reply: Optional[bool]=None,
|
||||
max_tip_amount: Optional[int] = None,
|
||||
suggested_tip_amounts: Optional[List[int]]=None,
|
||||
protect_content: Optional[bool]=None) -> types.Message:
|
||||
protect_content: Optional[bool]=None,
|
||||
message_thread_id: Optional[int]=None) -> types.Message:
|
||||
"""
|
||||
Sends invoice.
|
||||
|
||||
@@ -4726,6 +4798,9 @@ class AsyncTeleBot:
|
||||
:param protect_content: Protects the contents of the sent message from forwarding and saving
|
||||
:type protect_content: :obj:`bool`
|
||||
|
||||
:param message_thread_id: The identifier of a message thread, in which the invoice message will be sent
|
||||
:type message_thread_id: :obj:`int`
|
||||
|
||||
:return: On success, the sent Message is returned.
|
||||
:rtype: :obj:`types.Message`
|
||||
"""
|
||||
@@ -4739,7 +4814,7 @@ class AsyncTeleBot:
|
||||
photo_height, need_name, need_phone_number, need_email, need_shipping_address,
|
||||
send_phone_number_to_provider, send_email_to_provider, is_flexible, disable_notification,
|
||||
reply_to_message_id, reply_markup, provider_data, timeout, allow_sending_without_reply,
|
||||
max_tip_amount, suggested_tip_amounts, protect_content)
|
||||
max_tip_amount, suggested_tip_amounts, protect_content, message_thread_id)
|
||||
return types.Message.de_json(result)
|
||||
|
||||
|
||||
@@ -4863,7 +4938,8 @@ class AsyncTeleBot:
|
||||
allow_sending_without_reply: Optional[bool]=None,
|
||||
timeout: Optional[int]=None,
|
||||
explanation_entities: Optional[List[types.MessageEntity]]=None,
|
||||
protect_content: Optional[bool]=None) -> types.Message:
|
||||
protect_content: Optional[bool]=None,
|
||||
message_thread_id: Optional[int]=None) -> types.Message:
|
||||
"""
|
||||
Use this method to send a native poll.
|
||||
On success, the sent Message is returned.
|
||||
@@ -4931,6 +5007,9 @@ class AsyncTeleBot:
|
||||
:param protect_content: Protects the contents of the sent message from forwarding and saving
|
||||
:type protect_content: :obj:`bool`
|
||||
|
||||
:param message_thread_id: The identifier of a message thread, in which the poll will be sent
|
||||
:type message_thread_id: :obj:`int`
|
||||
|
||||
:return: On success, the sent Message is returned.
|
||||
:rtype: :obj:`types.Message`
|
||||
"""
|
||||
@@ -4949,7 +5028,7 @@ class AsyncTeleBot:
|
||||
is_anonymous, type, allows_multiple_answers, correct_option_id,
|
||||
explanation, explanation_parse_mode, open_period, close_date, is_closed,
|
||||
disable_notification, reply_to_message_id, allow_sending_without_reply,
|
||||
reply_markup, timeout, explanation_entities, protect_content))
|
||||
reply_markup, timeout, explanation_entities, protect_content, message_thread_id))
|
||||
|
||||
async def stop_poll(
|
||||
self, chat_id: Union[int, str], message_id: int,
|
||||
@@ -5403,7 +5482,9 @@ class AsyncTeleBot:
|
||||
:return: On success, information about the created topic is returned as a ForumTopic object.
|
||||
:rtype: :class:`telebot.types.ForumTopic`
|
||||
"""
|
||||
return await asyncio_helper.create_forum_topic(self.token, chat_id, name, icon_color, icon_custom_emoji_id)
|
||||
return types.ForumTopic.de_json(
|
||||
await asyncio_helper.create_forum_topic(self.token, chat_id, name, icon_color, icon_custom_emoji_id)
|
||||
)
|
||||
|
||||
async def edit_forum_topic(
|
||||
self, chat_id: Union[int, str],
|
||||
|
||||
Reference in New Issue
Block a user