From b84c50d58b214217f2d5b2141616078accc51d76 Mon Sep 17 00:00:00 2001 From: Groosha Date: Tue, 6 Oct 2020 17:29:27 +0300 Subject: [PATCH] Added deprecation warning to SUPER_GROUP value --- aiogram/types/chat.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/aiogram/types/chat.py b/aiogram/types/chat.py index 5e179822..7fcea5ea 100644 --- a/aiogram/types/chat.py +++ b/aiogram/types/chat.py @@ -10,7 +10,7 @@ from .chat_member import ChatMember from .chat_permissions import ChatPermissions from .chat_photo import ChatPhoto from .input_file import InputFile -from ..utils.deprecated import deprecated +from ..utils.deprecated import deprecated, DeprecatedReadOnlyClassVar class Chat(base.TelegramObject): @@ -502,10 +502,14 @@ class ChatType(helper.Helper): PRIVATE = helper.Item() # private GROUP = helper.Item() # group - SUPER_GROUP = helper.Item() # supergroup SUPERGROUP = helper.Item() # supergroup CHANNEL = helper.Item() # channel + SUPER_GROUP: DeprecatedReadOnlyClassVar[ChatType, helper.Item] \ + = DeprecatedReadOnlyClassVar( + "SUPER_GROUP chat type is deprecated, use SUPERGROUP instead.", + new_value_getter=lambda cls: cls.SUPERGROUP) + @staticmethod def _check(obj, chat_types) -> bool: if hasattr(obj, 'chat'):