diff --git a/bot/decorators/only_admins.py b/bot/decorators/only_admins.py index 2eecc9b..042ef6f 100644 --- a/bot/decorators/only_admins.py +++ b/bot/decorators/only_admins.py @@ -6,6 +6,9 @@ def only_admins(func): + """ + Allow only admins to use any command. + """ @functools.wraps(func) async def _(client: Client, message: Message): if not message.chat.type == ChatType.PRIVATE: diff --git a/bot/decorators/only_managers.py b/bot/decorators/only_managers.py index 59c7891..4c198b3 100644 --- a/bot/decorators/only_managers.py +++ b/bot/decorators/only_managers.py @@ -7,6 +7,9 @@ def only_managers(func): + """ + Allow only admins and user requester to use any command. + """ @functools.wraps(func) async def _(client: Client, any): try: @@ -29,8 +32,8 @@ async def _(client: Client, any): text="**__You are not my master or played user, you cannot execute this action.__** \U0001f621", show_alert=True, ) + await func(client, any) except Exception as e: logging.error(e) - await func(client, any) return _