From 9238c27d5a7d69f2ca876d883ecff1546223c347 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Tue, 8 Aug 2023 00:24:47 -0400 Subject: [PATCH] fix: added guild_only decorators to all the config commands --- shortmute/shortmute.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shortmute/shortmute.py b/shortmute/shortmute.py index e2028d8..9add5e2 100644 --- a/shortmute/shortmute.py +++ b/shortmute/shortmute.py @@ -121,6 +121,7 @@ class Shortmute(commands.Cog): """This command group is used to configure the `/shortmute` slash command.""" @shortmute_config.command(name='addchannel') + @commands.guild_only() async def shortmute_config_addchannel(self, ctx: commands.Context, channel: discord.TextChannel = None): """This command changes where the `/shortmute` slash command will log shortmutes. You can set multiple channels as well!""" current_list = await self.config.guild(ctx.guild.id).logging_channels() @@ -144,6 +145,7 @@ class Shortmute(commands.Cog): await ctx.send("Please provide a valid channel.") @shortmute_config.command(name='removechannel') + @commands.guild_only() async def shortmute_config_removechannel(self, ctx: commands.Context, channel: discord.TextChannel = None): """This command removes a channel from the `/shortmute`slash command's logging channels list.""" current_list = await self.config.guild(ctx.guild.id).logging_channels() @@ -155,6 +157,7 @@ class Shortmute(commands.Cog): await ctx.send("Please provide a valid channel that exists in the logging channels list.") @shortmute_config.command(name='dm') + @commands.guild_only() async def shortmute_config_dm(self, ctx: commands.Context, enabled: bool = None): """This command changes if the `/shortmute` slash command Direct Messages its target.""" old_value = await self.config.guild(ctx.guild.id).dm()