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

Changed custom permissions to send_message as the lowest

This commit is contained in:
Phxntxm 2016-07-17 15:23:38 -05:00
parent 6aab05fd7b
commit d9475412cf
2 changed files with 8 additions and 5 deletions

View file

@ -92,6 +92,8 @@ class Mod:
If you want to open the command to everyone, provide 'none' as the permission"""
command = " ".join(msg[0:len(msg)-1])
permissions = msg[len(msg)-1]
if permissions.lower() = "none":
permissions = "send_message"
msg = msg[0:len(msg)-1]
count = 0
cmd = self.bot.commands.get(msg[count])

View file

@ -13,13 +13,14 @@ def customPermsOrRole(perm):
return False
custom_permissions = config.getContent('custom_permissions')
try:
perm = custom_permissions[ctx.message.server.id][str(ctx.command)]
_perm = custom_permissions[ctx.message.server.id][str(ctx.command)]
except KeyError:
pass
if perm == "none":
return True
return getattr(ctx.message.author.permissions_in(ctx.message.channel),perm)
if _perm is None:
return getattr(ctx.message.author.permissions_in(ctx.message.channel),perm)
else:
return getattr(ctx.message.author.permissions_in(ctx.message.channel),_perm)
return commands.check(predicate)