From c129c7bc60103b742846f4a649e389256552dd31 Mon Sep 17 00:00:00 2001 From: seel2304 <37144504+seel2304@users.noreply.github.com> Date: Wed, 3 May 2023 10:36:12 +0000 Subject: [PATCH] Disable cooldown for admins --- bot/utils/cooldown.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/utils/cooldown.py b/bot/utils/cooldown.py index 47bb29b..d997cf5 100644 --- a/bot/utils/cooldown.py +++ b/bot/utils/cooldown.py @@ -30,7 +30,7 @@ def throttle(cooldown: int = 5, by_id: bool = True, admin_ids: list = None): if not last_time: last_time = delta - if last_time <= delta: + if last_time <= delta or user_id in admin_ids: try: f_name_dict = db[DBTables.cooldown][func.__name__] f_name_dict[user_id] = now @@ -42,7 +42,7 @@ def throttle(cooldown: int = 5, by_id: bool = True, admin_ids: list = None): try: return asyncio.create_task(func(*args, **kwargs)) except Exception as e: - assert e + assert e else: return not_allowed(*args, cooldown, by_id)