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:
@@ -1488,7 +1488,8 @@ class TeleBot:
|
||||
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.
|
||||
|
||||
@@ -1532,6 +1533,9 @@ class TeleBot:
|
||||
: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`
|
||||
"""
|
||||
@@ -1545,13 +1549,14 @@ class TeleBot:
|
||||
apihelper.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=protect_content))
|
||||
entities, allow_sending_without_reply, protect_content=protect_content, message_thread_id=message_thread_id))
|
||||
|
||||
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.
|
||||
|
||||
@@ -1575,6 +1580,9 @@ class TeleBot:
|
||||
: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`
|
||||
"""
|
||||
@@ -1582,7 +1590,8 @@ class TeleBot:
|
||||
protect_content = self.protect_content if (protect_content is None) else protect_content
|
||||
|
||||
return types.Message.de_json(
|
||||
apihelper.forward_message(self.token, chat_id, from_chat_id, message_id, disable_notification, timeout, protect_content))
|
||||
apihelper.forward_message(self.token, chat_id, from_chat_id, message_id, disable_notification, timeout, protect_content,
|
||||
message_thread_id))
|
||||
|
||||
|
||||
def copy_message(
|
||||
@@ -1597,7 +1606,8 @@ class TeleBot:
|
||||
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.
|
||||
|
||||
@@ -1639,6 +1649,9 @@ class TeleBot:
|
||||
|
||||
: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`
|
||||
@@ -1651,7 +1664,7 @@ class TeleBot:
|
||||
return types.MessageID.de_json(
|
||||
apihelper.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))
|
||||
|
||||
def delete_message(self, chat_id: Union[int, str], message_id: int,
|
||||
timeout: Optional[int]=None) -> bool:
|
||||
@@ -1689,7 +1702,8 @@ class TeleBot:
|
||||
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.
|
||||
|
||||
@@ -1722,6 +1736,9 @@ class TeleBot:
|
||||
:param protect_content: Protects the contents of the sent message from forwarding
|
||||
: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`
|
||||
"""
|
||||
@@ -1732,7 +1749,7 @@ class TeleBot:
|
||||
return types.Message.de_json(
|
||||
apihelper.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)
|
||||
)
|
||||
|
||||
|
||||
@@ -1745,7 +1762,8 @@ class TeleBot:
|
||||
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.
|
||||
|
||||
@@ -1787,6 +1805,9 @@ class TeleBot:
|
||||
|
||||
: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`
|
||||
@@ -1800,7 +1821,7 @@ class TeleBot:
|
||||
apihelper.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))
|
||||
|
||||
# TODO: Rewrite this method like in API.
|
||||
def send_audio(
|
||||
@@ -1815,7 +1836,8 @@ class TeleBot:
|
||||
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,
|
||||
@@ -1876,6 +1898,9 @@ class TeleBot:
|
||||
: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`
|
||||
"""
|
||||
@@ -1888,7 +1913,7 @@ class TeleBot:
|
||||
apihelper.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))
|
||||
|
||||
# TODO: Rewrite this method like in API.
|
||||
def send_voice(
|
||||
@@ -1901,7 +1926,8 @@ class TeleBot:
|
||||
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).
|
||||
@@ -1948,6 +1974,9 @@ class TeleBot:
|
||||
: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
|
||||
@@ -1959,7 +1988,7 @@ class TeleBot:
|
||||
apihelper.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))
|
||||
|
||||
# TODO: Rewrite this method like in API.
|
||||
def send_document(
|
||||
@@ -1976,7 +2005,7 @@ class TeleBot:
|
||||
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.
|
||||
|
||||
@@ -2030,6 +2059,9 @@ class TeleBot:
|
||||
: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`
|
||||
"""
|
||||
@@ -2049,7 +2081,7 @@ class TeleBot:
|
||||
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))
|
||||
protect_content = protect_content, message_thread_id = message_thread_id))
|
||||
|
||||
|
||||
# TODO: Rewrite this method like in API.
|
||||
@@ -2062,7 +2094,8 @@ class TeleBot:
|
||||
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.
|
||||
@@ -2099,6 +2132,9 @@ class TeleBot:
|
||||
:param data: function typo miss compatibility: do not use it
|
||||
:type data: :obj:`str`
|
||||
|
||||
: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`
|
||||
"""
|
||||
@@ -2116,7 +2152,7 @@ class TeleBot:
|
||||
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))
|
||||
protect_content=protect_content, message_thread_id=message_thread_id))
|
||||
|
||||
def send_video(
|
||||
self, chat_id: Union[int, str], video: Union[Any, str],
|
||||
@@ -2134,7 +2170,8 @@ class TeleBot:
|
||||
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).
|
||||
|
||||
@@ -2193,6 +2230,9 @@ class TeleBot:
|
||||
: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`
|
||||
"""
|
||||
@@ -2209,7 +2249,7 @@ class TeleBot:
|
||||
apihelper.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))
|
||||
|
||||
def send_animation(
|
||||
self, chat_id: Union[int, str], animation: Union[Any, str],
|
||||
@@ -2225,7 +2265,8 @@ class TeleBot:
|
||||
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.
|
||||
@@ -2283,6 +2324,9 @@ class TeleBot:
|
||||
: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`
|
||||
"""
|
||||
@@ -2295,7 +2339,7 @@ class TeleBot:
|
||||
apihelper.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, protect_content, width, height))
|
||||
caption_entities, allow_sending_without_reply, protect_content, width, height, message_thread_id))
|
||||
|
||||
# TODO: Rewrite this method like in API.
|
||||
def send_video_note(
|
||||
@@ -2308,7 +2352,8 @@ class TeleBot:
|
||||
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.
|
||||
@@ -2354,6 +2399,9 @@ class TeleBot:
|
||||
: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`
|
||||
"""
|
||||
@@ -2364,7 +2412,7 @@ class TeleBot:
|
||||
return types.Message.de_json(
|
||||
apihelper.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))
|
||||
|
||||
|
||||
def send_media_group(
|
||||
@@ -2376,7 +2424,8 @@ class TeleBot:
|
||||
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.
|
||||
@@ -2404,6 +2453,9 @@ class TeleBot:
|
||||
: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 media group 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]
|
||||
"""
|
||||
@@ -2413,7 +2465,7 @@ class TeleBot:
|
||||
|
||||
result = apihelper.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]
|
||||
|
||||
# TODO: Rewrite this method like in API.
|
||||
@@ -2429,7 +2481,8 @@ class TeleBot:
|
||||
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.
|
||||
|
||||
@@ -2476,6 +2529,9 @@ class TeleBot:
|
||||
: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`
|
||||
"""
|
||||
@@ -2488,7 +2544,7 @@ class TeleBot:
|
||||
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))
|
||||
|
||||
def edit_message_live_location(
|
||||
self, latitude: float, longitude: float,
|
||||
@@ -2596,7 +2652,8 @@ class TeleBot:
|
||||
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.
|
||||
|
||||
@@ -2651,6 +2708,9 @@ class TeleBot:
|
||||
: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 identifier of a message from which the reply will be sent
|
||||
:type message_thread_id: :obj:`int`
|
||||
|
||||
:return: On success, the sent Message is returned.
|
||||
:rtype: :class:`telebot.types.Message`
|
||||
"""
|
||||
@@ -2662,7 +2722,7 @@ class TeleBot:
|
||||
apihelper.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))
|
||||
|
||||
|
||||
# TODO: Rewrite this method like in API.
|
||||
@@ -2675,7 +2735,7 @@ class TeleBot:
|
||||
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.
|
||||
|
||||
@@ -2717,6 +2777,9 @@ class TeleBot:
|
||||
: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 identifier of a message from which the reply will be sent
|
||||
:type message_thread_id: :obj:`int`
|
||||
|
||||
:return: On success, the sent Message is returned.
|
||||
:rtype: :class:`telebot.types.Message`
|
||||
"""
|
||||
@@ -2728,7 +2791,7 @@ class TeleBot:
|
||||
apihelper.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))
|
||||
|
||||
def send_chat_action(
|
||||
self, chat_id: Union[int, str], action: str, timeout: Optional[int]=None) -> bool:
|
||||
@@ -3643,7 +3706,8 @@ class TeleBot:
|
||||
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.
|
||||
|
||||
@@ -3673,6 +3737,9 @@ class TeleBot:
|
||||
: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: The identifier of a message thread, in which the game message will be sent.
|
||||
:type message_thread_id: :obj:`int`
|
||||
|
||||
:return: On success, the sent Message is returned.
|
||||
:rtype: :obj:`types.Message`
|
||||
"""
|
||||
@@ -3683,7 +3750,7 @@ class TeleBot:
|
||||
result = apihelper.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)
|
||||
|
||||
def set_game_score(
|
||||
@@ -3780,7 +3847,8 @@ class TeleBot:
|
||||
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.
|
||||
|
||||
@@ -3879,6 +3947,9 @@ class TeleBot:
|
||||
: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`
|
||||
"""
|
||||
@@ -3892,7 +3963,7 @@ class TeleBot:
|
||||
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)
|
||||
|
||||
def create_invoice_link(self,
|
||||
@@ -4016,7 +4087,8 @@ class TeleBot:
|
||||
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.
|
||||
@@ -4084,6 +4156,9 @@ class TeleBot:
|
||||
: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`
|
||||
"""
|
||||
@@ -4103,7 +4178,7 @@ class TeleBot:
|
||||
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))
|
||||
|
||||
def stop_poll(
|
||||
self, chat_id: Union[int, str], message_id: int,
|
||||
@@ -4555,7 +4630,9 @@ class TeleBot:
|
||||
:return: On success, information about the created topic is returned as a ForumTopic object.
|
||||
:rtype: :class:`telebot.types.ForumTopic`
|
||||
"""
|
||||
return apihelper.create_forum_topic(self.token, chat_id, name, icon_color, icon_custom_emoji_id)
|
||||
return types.ForumTopic(
|
||||
apihelper.create_forum_topic(self.token, chat_id, name, icon_color, icon_custom_emoji_id)
|
||||
)
|
||||
|
||||
def edit_forum_topic(
|
||||
self, chat_id: Union[int, str],
|
||||
|
||||
Reference in New Issue
Block a user