From e8c1728835463e4837740d47387c95b461f2c24d Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Sun, 4 Jul 2021 23:04:45 +0300 Subject: [PATCH] Make BotCommandScope classmethod instead of method --- aiogram/types/bot_command_scope.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aiogram/types/bot_command_scope.py b/aiogram/types/bot_command_scope.py index 2705e0e3..e3091a7e 100644 --- a/aiogram/types/bot_command_scope.py +++ b/aiogram/types/bot_command_scope.py @@ -32,7 +32,8 @@ class BotCommandScope(base.TelegramObject): """ type: base.String = fields.Field() - def from_type(self, type: str, **kwargs: typing.Any): + @classmethod + def from_type(cls, type: str, **kwargs: typing.Any): if type == BotCommandScopeType.DEFAULT: return BotCommandScopeDefault(type=type, **kwargs) if type == BotCommandScopeType.ALL_PRIVATE_CHATS: