Changed tag add command to accept groups
This commit is contained in:
parent
3aff0c50e8
commit
3e40d1665d
13
cogs/mod.py
13
cogs/mod.py
|
@ -99,8 +99,17 @@ class Mod:
|
||||||
|
|
||||||
@perms.command(name="add", aliases=["setup,create"], pass_context=True)
|
@perms.command(name="add", aliases=["setup,create"], pass_context=True)
|
||||||
@commands.has_permissions(manage_server=True)
|
@commands.has_permissions(manage_server=True)
|
||||||
async def add_perms(self, ctx, command: str, permissions: str):
|
async def add_perms(self, ctx, *msg: str):
|
||||||
for check in self.bot.commands.get(command).checks:
|
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__:
|
if "isOwner" == check.__name__:
|
||||||
await self.bot.say("This command cannot have custom permissions setup!")
|
await self.bot.say("This command cannot have custom permissions setup!")
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue