diff options
| author | 2019-01-10 17:58:19 -0500 | |
|---|---|---|
| committer | 2019-01-10 17:58:19 -0500 | |
| commit | c55fa67e21a6a10feb0738b3bacd6b0dba1d4de9 (patch) | |
| tree | 4577172c3d79873fbe2d4ebe6934887dea7efa1a | |
| parent | Add 2nd space to inline comment to obey allmighty linter (diff) | |
Add cooldown constants to config
| -rw-r--r-- | bot/cogs/free.py | 4 | ||||
| -rw-r--r-- | bot/constants.py | 2 | ||||
| -rw-r--r-- | config-default.yml | 2 | 
3 files changed, 7 insertions, 1 deletions
diff --git a/bot/cogs/free.py b/bot/cogs/free.py index acd1dc108..8d413a69b 100644 --- a/bot/cogs/free.py +++ b/bot/cogs/free.py @@ -11,6 +11,8 @@ from bot.constants import Categories, Free, Roles  log = logging.getLogger(__name__)  TIMEOUT = Free.activity_timeout +RATE = Free.cooldown_rate +PER = Free.cooldown_per  class Free: @@ -19,7 +21,7 @@ class Free:      PYTHON_HELP_ID = Categories.python_help      @command(name="free", aliases=('f',)) -    @cooldown(1, 60.0, BucketType.channel) +    @cooldown(RATE, PER, BucketType.channel)      async def free(self, ctx: Context, user: Member = None, seek: int = 2):          """          Lists free help channels by likeliness of availability. diff --git a/bot/constants.py b/bot/constants.py index 1bb602eb2..be713cef2 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -477,6 +477,8 @@ class Free(metaclass=YAMLGetter):      section = 'free'      activity_timeout: int +    cooldown_rate: int +    cooldown_per: float  # Debug mode diff --git a/config-default.yml b/config-default.yml index 3db7b2025..f462b8199 100644 --- a/config-default.yml +++ b/config-default.yml @@ -343,6 +343,8 @@ free:      # Seconds to elapse for a channel      # to be considered inactive.      activity_timeout: 600 +    cooldown_rate: 1 +    cooldown_per: 60.0  config:  |