Skip to content

Commit ed66dba

Browse files
Fixing docstrings (#2126)
1 parent 95d3cd0 commit ed66dba

2 files changed

Lines changed: 34 additions & 13 deletions

File tree

telebot/__init__.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,7 +1368,9 @@ def close(self) -> bool:
13681368

13691369
def set_message_reaction(self, chat_id: Union[int, str], message_id: int, reaction: Optional[List[types.ReactionType]]=None, is_big: Optional[bool]=None) -> bool:
13701370
"""
1371-
Use this method to set a reaction to a message in a chat. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success.
1371+
Use this method to change the chosen reactions on a message.
1372+
Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same
1373+
available reactions as messages in the channel. Returns True on success.
13721374
13731375
Telegram documentation: https://core.telegram.org/bots/api#setmessagereaction
13741376
@@ -1841,9 +1843,7 @@ def delete_message(self, chat_id: Union[int, str], message_id: int,
18411843

18421844
def delete_messages(self, chat_id: Union[int, str], message_ids: List[int]):
18431845
"""
1844-
Use this method to delete multiple messages in a chat.
1845-
The number of messages to be deleted must not exceed 100.
1846-
If the chat is a private chat, the user must be an administrator of the chat for this to work and must have the appropriate admin rights.
1846+
Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped.
18471847
Returns True on success.
18481848
18491849
Telegram documentation: https://core.telegram.org/bots/api#deletemessages
@@ -1863,7 +1863,11 @@ def delete_messages(self, chat_id: Union[int, str], message_ids: List[int]):
18631863
def forward_messages(self, chat_id: Union[str, int], from_chat_id: Union[str, int], message_ids: List[int], disable_notification: Optional[bool]=None,
18641864
message_thread_id: Optional[int]=None, protect_content: Optional[bool]=None) -> List[types.MessageID]:
18651865
"""
1866-
Use this method to forward messages of any kind.
1866+
Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped.
1867+
Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages.
1868+
On success, an array of MessageId of the sent messages is returned.
1869+
1870+
Telegram documentation: https://core.telegram.org/bots/api#forwardmessages
18671871
18681872
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
18691873
:type chat_id: :obj:`int` or :obj:`str`
@@ -1901,7 +1905,14 @@ def copy_messages(self, chat_id: Union[str, int], from_chat_id: Union[str, int],
19011905
disable_notification: Optional[bool] = None, message_thread_id: Optional[int] = None,
19021906
protect_content: Optional[bool] = None, remove_caption: Optional[bool] = None) -> List[types.MessageID]:
19031907
"""
1904-
Use this method to copy messages of any kind.
1908+
Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped.
1909+
Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied.
1910+
A quiz poll can be copied only if the value of the field correct_option_id is known to the bot.
1911+
The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message.
1912+
Album grouping is kept for copied messages. On success, an array of MessageId of the sent messages is returned.
1913+
1914+
Telegram documentation: https://core.telegram.org/bots/api#copymessages
1915+
19051916
19061917
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
19071918
:type chat_id: :obj:`int` or :obj:`str`

telebot/async_telebot.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2422,7 +2422,9 @@ async def get_webhook_info(self, timeout: Optional[int]=None) -> types.WebhookIn
24222422

24232423
async def set_message_reaction(self, chat_id: Union[int, str], message_id: int, reaction: Optional[List[types.ReactionType]]=None, is_big: Optional[bool]=None) -> bool:
24242424
"""
2425-
Use this method to set a reaction to a message in a chat. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success.
2425+
Use this method to change the chosen reactions on a message.
2426+
Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same
2427+
available reactions as messages in the channel. Returns True on success.
24262428
24272429
Telegram documentation: https://core.telegram.org/bots/api#setmessagereaction
24282430
@@ -2911,10 +2913,8 @@ async def delete_message(self, chat_id: Union[int, str], message_id: int,
29112913

29122914
async def delete_messages(self, chat_id: Union[int, str], message_ids: List[int]):
29132915
"""
2914-
Use this method to delete multiple messages in a chat.
2915-
The number of messages to be deleted must not exceed 100.
2916-
If the chat is a private chat, the user must be an administrator of the chat for this to work and must have the appropriate admin rights.
2917-
Returns True on success.
2916+
Use this method to delete multiple messages simultaneously.
2917+
If some of the specified messages can't be found, they are skipped. Returns True on success.
29182918
29192919
Telegram documentation: https://core.telegram.org/bots/api#deletemessages
29202920
@@ -2932,7 +2932,11 @@ async def delete_messages(self, chat_id: Union[int, str], message_ids: List[int]
29322932
async def forward_messages(self, chat_id: Union[str, int], from_chat_id: Union[str, int], message_ids: List[int], disable_notification: Optional[bool]=None,
29332933
message_thread_id: Optional[int]=None, protect_content: Optional[bool]=None) -> List[types.MessageID]:
29342934
"""
2935-
Use this method to forward messages of any kind.
2935+
Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded,
2936+
they are skipped. Service messages and messages with protected content can't be forwarded.
2937+
Album grouping is kept for forwarded messages. On success, an array of MessageId of the sent messages is returned.
2938+
2939+
Telegram documentation: https://core.telegram.org/bots/api#forwardmessages
29362940
29372941
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
29382942
:type chat_id: :obj:`int` or :obj:`str`
@@ -2965,7 +2969,13 @@ async def copy_messages(self, chat_id: Union[str, int], from_chat_id: Union[str,
29652969
disable_notification: Optional[bool] = None, message_thread_id: Optional[int] = None,
29662970
protect_content: Optional[bool] = None, remove_caption: Optional[bool] = None) -> List[types.MessageID]:
29672971
"""
2968-
Use this method to copy messages of any kind.
2972+
Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped.
2973+
Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied
2974+
only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but
2975+
the copied messages don't have a link to the original message. Album grouping is kept for copied messages.
2976+
On success, an array of MessageId of the sent messages is returned.
2977+
2978+
Telegram documentation: https://core.telegram.org/bots/api#copymessages
29692979
29702980
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
29712981
:type chat_id: :obj:`int` or :obj:`str`

0 commit comments

Comments
 (0)