Browse Source

moved requirements for permissions to the commands instead of the group so that normal users can list the commands.

tags/v2.0.0
Roxie Gibson 5 years ago
parent
commit
f86df18732
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      roxbot/cogs/customcommands.py

+ 3
- 1
roxbot/cogs/customcommands.py View File

command_output = self._get_output(settings["custom_commands"]["0"][command]) command_output = self._get_output(settings["custom_commands"]["0"][command])
return await channel.send(command_output) return await channel.send(command_output)


@commands.has_permissions(manage_messages=True)
@commands.guild_only() @commands.guild_only()
@commands.group(aliases=["cc"]) @commands.group(aliases=["cc"])
async def custom(self, ctx): async def custom(self, ctx):
if ctx.invoked_subcommand is None: if ctx.invoked_subcommand is None:
return await ctx.send('Missing Argument') return await ctx.send('Missing Argument')


@commands.has_permissions(manage_messages=True)
@custom.command() @custom.command()
async def add(self, ctx, command_type, command, *output): async def add(self, ctx, command_type, command, *output):
"""Adds a custom command to the list of custom commands.""" """Adds a custom command to the list of custom commands."""
settings.update(settings["custom_commands"], "custom_commands") settings.update(settings["custom_commands"], "custom_commands")
return await ctx.send(self.OUTPUT_ADD.format(command, output)) return await ctx.send(self.OUTPUT_ADD.format(command, output))


@commands.has_permissions(manage_messages=True)
@custom.command() @custom.command()
async def edit(self, ctx, command, *edit): async def edit(self, ctx, command, *edit):
""""Edits an existing custom command.""" """"Edits an existing custom command."""
else: else:
return await ctx.send(self.ERROR_COMMAND_NULL) return await ctx.send(self.ERROR_COMMAND_NULL)


@commands.has_permissions(manage_messages=True)
@custom.command() @custom.command()
async def remove(self, ctx, command): async def remove(self, ctx, command):
""""Removes a custom command.""" """"Removes a custom command."""

Loading…
Cancel
Save