diff options
| author | 2020-07-01 00:31:12 +0000 | |
|---|---|---|
| committer | 2020-07-01 00:31:12 +0000 | |
| commit | 2172154c8cfe77b495e3c71716c3df339bf573b1 (patch) | |
| tree | 0c0e639626d1cb2d84c90c35e8b80225296b54fb | |
| parent | Implement the get_slowmode function (diff) | |
Implement the set_slowmode function
| -rw-r--r-- | bot/cogs/slowmode.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bot/cogs/slowmode.py b/bot/cogs/slowmode.py index d4226acec..bab6eccd0 100644 --- a/bot/cogs/slowmode.py +++ b/bot/cogs/slowmode.py @@ -2,7 +2,7 @@ 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.constants import Emojis, MODERATION_ROLES from bot.decorators import with_role @@ -26,6 +26,10 @@ class Slowmode(Cog): @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.""" + await channel.edit(slowmode_delay=seconds) + await ctx.send( + f'{Emojis.check_mark} The slowmode delay for {channel.mention} is now {seconds} seconds.' + ) def setup(bot: Bot) -> None: |