mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
enh: alias is_chat_owner for is_chat_creator
This commit is contained in:
parent
927128a898
commit
bd01c375f7
1 changed files with 4 additions and 0 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue