diff options
| author | 2020-07-06 00:59:15 +0000 | |
|---|---|---|
| committer | 2020-07-06 00:59:15 +0000 | |
| commit | 539030a1c2a79efe23541704f0026a072ba064ed (patch) | |
| tree | a1340c999ec67bee6b4137f533e03f7b6b70cfc3 | |
| parent | Remove monkeypatch and apply appropriate changes to _stringify_time_unit (diff) | |
Default to the channel that `slowmode get` was invoked in
| -rw-r--r-- | bot/cogs/slowmode.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bot/cogs/slowmode.py b/bot/cogs/slowmode.py index 88f19b2f1..7405c1e7f 100644 --- a/bot/cogs/slowmode.py +++ b/bot/cogs/slowmode.py @@ -1,5 +1,6 @@ import logging from datetime import datetime +from typing import Optional from dateutil.relativedelta import relativedelta from discord import TextChannel @@ -28,8 +29,12 @@ class Slowmode(Cog): await ctx.send_help(ctx.command) @slowmode_group.command(name='get', aliases=['g']) - async def get_slowmode(self, ctx: Context, channel: TextChannel) -> None: + async def get_slowmode(self, ctx: Context, channel: Optional[TextChannel] = None) -> None: """Get the slowmode delay for a given text channel.""" + # Use the channel this command was invoked in if one was not given + if channel is None: + channel = ctx.channel + delay = relativedelta(seconds=channel.slowmode_delay) humanized_delay = time.humanize_delta(delay) |