Skip to content

Commit

Permalink
Fix description
Browse files Browse the repository at this point in the history
  • Loading branch information
coder2020official committed Feb 5, 2023
1 parent a9b8781 commit 4179e50
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
6 changes: 2 additions & 4 deletions telebot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2928,8 +2928,7 @@ def restrict_chat_member(
Telegram documentation: https://core.telegram.org/bots/api#restrictchatmember
.. warning::
Please pass `telebot.types.ChatPermissions` object to `permissions` parameter instead of
passing all boolean parameters. Those boolean parameters won't be supported soon, so please take it into consideration.
Individual parameters are deprecated and will be removed, use 'permissions' instead.
:param chat_id: Unique identifier for the target group or username of the target supergroup
or channel (in the format @channelusername)
Expand Down Expand Up @@ -2997,8 +2996,7 @@ def restrict_chat_member(
can_pin_messages=can_pin_messages
)
logger.warning(
'Please pass `telebot.types.ChatPermissions` object to `permissions` parameter instead of '
'passing all boolean parameters. Those boolean parameters won\'t be supported soon, so please take it into consideration.'
"Individual parameters are deprecated and will be removed, use 'permissions' instead."
)
return apihelper.restrict_chat_member(
self.token, chat_id, user_id, permissions, until_date, use_independent_chat_permissions)
Expand Down
6 changes: 2 additions & 4 deletions telebot/async_telebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -3786,8 +3786,7 @@ async def restrict_chat_member(
Telegram documentation: https://core.telegram.org/bots/api#restrictchatmember
.. warning::
Please pass `telebot.types.ChatPermissions` object to `permissions` parameter instead of
passing all boolean parameters. Those boolean parameters won't be supported soon, so please take it into consideration.
Individual parameters are deprecated and will be removed, use 'permissions' instead
:param chat_id: Unique identifier for the target group or username of the target supergroup
or channel (in the format @channelusername)
Expand Down Expand Up @@ -3854,8 +3853,7 @@ async def restrict_chat_member(
can_pin_messages=can_pin_messages
)
logger.warning(
'Please pass `telebot.types.ChatPermissions` object to `permissions` parameter instead of '
'passing all boolean parameters. Those boolean parameters won\'t be supported soon, so please take it into consideration.'
"Individual parameters are deprecated and will be removed, use 'permissions' instead."
)
return await asyncio_helper.restrict_chat_member(
self.token, chat_id, user_id, permissions, until_date, use_independent_chat_permissions)
Expand Down
1 change: 1 addition & 0 deletions telebot/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -3163,6 +3163,7 @@ def __init__(self, can_send_messages=None, can_send_media_messages=None,can_send
self.can_send_voice_notes: bool = can_send_voice_notes

if can_send_media_messages is not None:
logger.warning("can_send_media_messages is deprecated. Use individual parameters like can_send_audios, can_send_documents, etc.")
self.can_send_audios = can_send_media_messages
self.can_send_documents = can_send_media_messages
self.can_send_photos = can_send_media_messages
Expand Down

0 comments on commit 4179e50

Please sign in to comment.