Make BotCommandScope classmethod instead of method

This commit is contained in:
Alex Root Junior 2021-07-04 23:04:45 +03:00
parent 056bd5a8db
commit e8c1728835

View file

@ -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: