mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-16 12:07:13 +00:00
Oops.
This commit is contained in:
parent
716865695c
commit
79edeaf960
1 changed files with 16 additions and 0 deletions
|
|
@ -14,3 +14,19 @@ class ChatMember(Deserializable):
|
|||
status = raw_data.get('status')
|
||||
|
||||
return ChatMember(user, status)
|
||||
|
||||
|
||||
class ChatMemberStatus:
|
||||
CREATOR = 'creator'
|
||||
ADMINISTRATOR = 'administrator'
|
||||
MEMBER = 'member'
|
||||
LEFT = 'left'
|
||||
KICKED = 'kicked'
|
||||
|
||||
@classmethod
|
||||
def is_admin(cls, role):
|
||||
return role in [cls.ADMINISTRATOR, cls.CREATOR]
|
||||
|
||||
@classmethod
|
||||
def is_member(cls, role):
|
||||
return role in [cls.MEMBER, cls.ADMINISTRATOR, cls.CREATOR]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue