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

Adding printing of perms and command for testing an error

This commit is contained in:
Phxntxm 2016-07-16 12:18:24 -05:00
parent 4f93370cdb
commit dd3fd91c8c

View file

@ -110,6 +110,8 @@ class Mod:
msg = msg[0:len(msg)-1]
count = 0
cmd = self.bot.commands.get(msg[count])
await self.bot.say("2: Trying to add `{}` permissions on `{}`".format(permissions, command))
await self.bot.say("Checking nesting for groups of commands")
while isinstance(cmd, commands.Group):
count += 1
try:
@ -117,16 +119,18 @@ class Mod:
except:
break
await self.bot.say("Checking for owner role commands, or commands that don't allow customer permissions")
for check in cmd.checks:
if "isOwner" == check.__name__ or "has_permissions" == re.search("has_permissions",str(check)).group(0):
await self.bot.say("This command cannot have custom permissions setup!")
return
await self.bot.say("Checking if {} is a valid permission".format(permissions))
if getattr(discord.Permissions, permissions, None) is None and not permissions.lower() == "none":
await self.bot.say("{} does not appear to be a valid permission! Valid permissions are: ```{}```"
.format(permissions, "\n".join(valid_perms)))
else:
await self.bot.say("Trying to add `{}` permissions on `{}`".format(permissions, command))
await self.bot.say("Permission is fine, continuing with MySQL stuff")
sid = ctx.message.server.id
cursor = config.getCursor()
cursor.execute('use {}'.format(config.db_perms))