diff --git a/telebot/__init__.py b/telebot/__init__.py index 70daddc..46669a6 100644 --- a/telebot/__init__.py +++ b/telebot/__init__.py @@ -2928,8 +2928,7 @@ class TeleBot: 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) @@ -2997,8 +2996,7 @@ class TeleBot: 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) diff --git a/telebot/async_telebot.py b/telebot/async_telebot.py index ebfaca5..d1fa77b 100644 --- a/telebot/async_telebot.py +++ b/telebot/async_telebot.py @@ -3786,8 +3786,7 @@ class AsyncTeleBot: 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) @@ -3854,8 +3853,7 @@ class AsyncTeleBot: 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) diff --git a/telebot/types.py b/telebot/types.py index b53706e..cb4facb 100644 --- a/telebot/types.py +++ b/telebot/types.py @@ -3163,6 +3163,7 @@ class ChatPermissions(JsonDeserializable, JsonSerializable, Dictionaryable): 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