fix: added guild_only decorators to all the config commands

This commit is contained in:
Seaswimmer 2023-08-08 00:24:47 -04:00
parent b71f9bf1d8
commit 9238c27d5a
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -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()