mirror of
https://gitflic.ru/project/maks1ms/ocab.git
synced 2024-12-23 16:23:01 +03:00
Добавлено получение id роли пользователя
This commit is contained in:
parent
cfaffd337d
commit
192b2ed51c
@ -41,3 +41,16 @@ class Roles:
|
||||
return self.bot
|
||||
case _:
|
||||
raise ValueError(f"Нет роли с id={role_id}")
|
||||
|
||||
async def get_user_permission(self, user_id):
|
||||
match get_user_role(user_id):
|
||||
case self.admin_role_id:
|
||||
return self.admin
|
||||
case self.moderator_role_id:
|
||||
return self.moderator
|
||||
case self.user_role_id:
|
||||
return self.user
|
||||
case self.bot_role_id:
|
||||
return self.bot
|
||||
case _:
|
||||
return None
|
Loading…
Reference in New Issue
Block a user