Disable cooldown for admins
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user