1
0
Fork 0
mirror of synced 2024-06-02 18:54:33 +12:00

Added ability to search for subcommand's permissions

This commit is contained in:
phxntxm 2016-07-15 17:23:13 -05:00
parent e1e8e59272
commit 2a2aa40b7f

View file

@ -71,13 +71,11 @@ class Mod:
await self.bot.delete_message(ctx.message) await self.bot.delete_message(ctx.message)
@commands.group(pass_context=True, invoke_without_command=True) @commands.group(pass_context=True, invoke_without_command=True)
async def perms(self, ctx, command: str=""): async def perms(self, ctx, *command: str):
if command == "": if command is None:
await self.bot.say("Valid permissions are: ```{}```".format("\n".join("{}".format(i) for i in valid_perms))) await self.bot.say("Valid permissions are: ```{}```".format("\n".join("{}".format(i) for i in valid_perms)))
return return
if command not in self.bot.commands: command = " ".join(command)
await self.bot.say("{} does not appear to be a valid command!".format(command))
return
cursor = config.getCursor() cursor = config.getCursor()
cursor.execute('use {}'.format(config.db_perms)) cursor.execute('use {}'.format(config.db_perms))