1
0
Fork 0
mirror of synced 2024-05-19 20:12:30 +12:00

Changed tag add command to accept groups

This commit is contained in:
phxntxm 2016-07-15 17:18:04 -05:00
parent 3aff0c50e8
commit 3e40d1665d

View file

@ -99,8 +99,17 @@ class Mod:
@perms.command(name="add", aliases=["setup,create"], pass_context=True)
@commands.has_permissions(manage_server=True)
async def add_perms(self, ctx, command: str, permissions: str):
for check in self.bot.commands.get(command).checks:
async def add_perms(self, ctx, *msg: str):
command = " ".join(msg[0:len(msg)-1])
permissions = msg[len(msg)-1]
msg = msg[0:len(msg)-1]
count = 0
cmd = self.bot.commands.get(msg[count])
while isinstance(cmd, commands.Group):
count += 1
cmd = cmd.get(msg[count])
for check in cmd.checks:
if "isOwner" == check.__name__:
await self.bot.say("This command cannot have custom permissions setup!")
return