fix: added guild_only decorators to all the config commands
This commit is contained in:
parent
b71f9bf1d8
commit
9238c27d5a
1 changed files with 3 additions and 0 deletions
|
@ -121,6 +121,7 @@ class Shortmute(commands.Cog):
|
||||||
"""This command group is used to configure the `/shortmute` slash command."""
|
"""This command group is used to configure the `/shortmute` slash command."""
|
||||||
|
|
||||||
@shortmute_config.command(name='addchannel')
|
@shortmute_config.command(name='addchannel')
|
||||||
|
@commands.guild_only()
|
||||||
async def shortmute_config_addchannel(self, ctx: commands.Context, channel: discord.TextChannel = None):
|
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!"""
|
"""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()
|
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.")
|
await ctx.send("Please provide a valid channel.")
|
||||||
|
|
||||||
@shortmute_config.command(name='removechannel')
|
@shortmute_config.command(name='removechannel')
|
||||||
|
@commands.guild_only()
|
||||||
async def shortmute_config_removechannel(self, ctx: commands.Context, channel: discord.TextChannel = None):
|
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."""
|
"""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()
|
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.")
|
await ctx.send("Please provide a valid channel that exists in the logging channels list.")
|
||||||
|
|
||||||
@shortmute_config.command(name='dm')
|
@shortmute_config.command(name='dm')
|
||||||
|
@commands.guild_only()
|
||||||
async def shortmute_config_dm(self, ctx: commands.Context, enabled: bool = None):
|
async def shortmute_config_dm(self, ctx: commands.Context, enabled: bool = None):
|
||||||
"""This command changes if the `/shortmute` slash command Direct Messages its target."""
|
"""This command changes if the `/shortmute` slash command Direct Messages its target."""
|
||||||
old_value = await self.config.guild(ctx.guild.id).dm()
|
old_value = await self.config.guild(ctx.guild.id).dm()
|
||||||
|
|
Loading…
Reference in a new issue