aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Den4200 <[email protected]>2020-07-01 00:28:05 +0000
committerGravatar Den4200 <[email protected]>2020-07-01 00:28:05 +0000
commit3ec5a69f8e1709aca55da3abc24cb2e632ae1ddb (patch)
treebfe597d7250bc4779a2260f0791074ff2898452c
parentAdd base Slowmode cog (diff)
Create boilerplate code for the commands
-rw-r--r--bot/cogs/slowmode.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/bot/cogs/slowmode.py b/bot/cogs/slowmode.py
index 96c069ab8..9140f3e8f 100644
--- a/bot/cogs/slowmode.py
+++ b/bot/cogs/slowmode.py
@@ -1,6 +1,9 @@
-from discord.ext.commands import Cog
+from discord import TextChannel
+from discord.ext.commands import Cog, Context, group
from bot.bot import Bot
+from bot.constants import MODERATION_ROLES
+from bot.decorators import with_role
class Slowmode(Cog):
@@ -8,6 +11,20 @@ class Slowmode(Cog):
def __init__(self, bot: Bot) -> None:
self.bot = bot
+ @group(name='slowmode', aliases=['sm'], invoke_without_command=True)
+ async def slowmode_group(self, ctx: Context) -> None:
+ """Get and set the slowmode delay for a given text channel."""
+ await ctx.send_help(ctx.command)
+
+ @slowmode_group.command(name='get', aliases=['g'])
+ async def get_slowmode(self, ctx: Context, channel: TextChannel) -> None:
+ """Get the slowmode delay for a given text channel."""
+
+ @slowmode_group.command(name='set', aliases=['s'])
+ @with_role(*MODERATION_ROLES)
+ async def set_slowmode(self, ctx: Context, channel: TextChannel, seconds: int) -> None:
+ """Set the slowmode delay for a given text channel."""
+
def setup(bot: Bot) -> None:
"""Load the Slowmode cog."""