diff --git a/robocop_ng/cogs/mod.py b/robocop_ng/cogs/mod.py index 9aac04a..8792391 100644 --- a/robocop_ng/cogs/mod.py +++ b/robocop_ng/cogs/mod.py @@ -3,7 +3,7 @@ from typing import Optional import discord from discord.ext import commands -from discord.ext.commands import Cog +from discord.ext.commands import Cog, Context from robocop_ng.helpers.checks import check_if_staff, check_if_bot_manager from robocop_ng.helpers.restrictions import add_restriction, remove_restriction @@ -914,11 +914,18 @@ class Mod(Cog): @commands.guild_only() @commands.check(check_if_staff) @commands.command(aliases=["slow"]) - async def slowmode(self, ctx, seconds: int): + async def slowmode( + self, ctx: Context, seconds: int, channel: Optional[discord.TextChannel] = None + ): + if channel is None: + channel = ctx.channel + if seconds > 21600 or seconds < 0: return await ctx.send("Seconds can't be above '21600' or less then '0'") - await ctx.channel.edit(slowmode_delay=seconds) + await channel.edit( + slowmode_delay=seconds, reason=f"{str(ctx.author)} set the slowmode" + ) await ctx.send(f"Set the slowmode delay in this channel to {seconds} seconds!")