enh: alias is_chat_owner for is_chat_creator

This commit is contained in:
uburuntu 2021-07-30 01:44:39 +03:00
parent 927128a898
commit bd01c375f7
No known key found for this signature in database
GPG key ID: 59E643252F903BE1

View file

@ -28,6 +28,8 @@ class ChatMemberStatus(helper.Helper):
def is_chat_creator(cls, role: str) -> bool:
return role == cls.CREATOR
is_chat_owner = is_chat_creator
@classmethod
def is_chat_admin(cls, role: str) -> bool:
return role in (cls.ADMINISTRATOR, cls.CREATOR)
@ -98,6 +100,8 @@ class ChatMember(base.TelegramObject):
def is_chat_creator(self) -> bool:
return ChatMemberStatus.is_chat_creator(self.status)
is_chat_owner = is_chat_creator
def is_chat_admin(self) -> bool:
return ChatMemberStatus.is_chat_admin(self.status)