-
Notifications
You must be signed in to change notification settings - Fork 0
Cooldown management
Yazaar edited this page Apr 15, 2023
·
3 revisions
Cooldown management can now be managed by importing App.py. (I have not coded a cooldown manager for JavaScript, yet at least)
from dependencies.modules.App import Tools
# create the cooldown manager object
cooldownManager = Tools.CooldownManager()
# Check for personal cooldown
# args: user
cooldownManager.onPersonalCooldown('yazaar')
# Returns True if on cooldown
# Returns False if on no cooldown
# Set personal cooldown
# args: user seconds
cooldownManager.setUserCooldown('yazaar', 60)
# Returns {'status':'Success', 'user':'yazaar', 'until':datetime object} if personal cooldown has been set
# Returns {'status':'Error', 'message':'The duration can not be negative or zero...'} if the duration is too small
# Check for global cooldown
cooldownManager.onGlobalCooldown()
# Returns True if on global cooldown
# Returns False if on no global cooldown
# Set global cooldown
# args: seconds
cooldownManager.setGlobalCooldown(5)
# Returns {'status':'Success', 'until':datetime object} if global cooldown has been set
# Returns {'status':'Error', 'message':'The duration can not be negative or zero...'} if the duration is too small