1
0
Fork 0
mirror of synced 2024-06-15 00:54:34 +12:00

Checking the actual permissions instead of the role

This commit is contained in:
phxntxm 2016-07-15 18:30:46 -05:00
parent 645f8fa85f
commit 03dda8afc8
2 changed files with 6 additions and 5 deletions

9
bot.py
View file

@ -63,10 +63,11 @@ async def on_command_error(error, ctx):
elif isinstance(error, commands.CheckFailure):
fmt = "You can't tell me what to do!"
await bot.send_message(ctx.message.channel, fmt)
#elif isinstance(error, commands.CommandInvokeError):
#print('In {0.command.qualified_name}:'.format(ctx), file=sys.stderr)
#traceback.print_tb(error.original.__traceback__)
#print('{0.__class__.__name__}: {0}'.format(error.original), file=sys.stderr)
elif isinstance(error, commands.CommandInvokeError):
f = open("/home/phxntx5/public_html/Bonfire/error_log", 'w')
print('In {0.command.qualified_name}:'.format(ctx), file=f)
traceback.print_tb(error.original.__traceback__, file=f)
print('{0.__class__.__name__}: {0}'.format(error.original), file=f)
else:
fmt = 'An error occurred while processing this request: ```py\n{}: {}\n```'
await bot.send_message(ctx.message.channel, fmt.format(type(error).__name__, error))

View file

@ -100,7 +100,7 @@ class Mod:
@perms.command(name="add", aliases=["setup,create"], pass_context=True)
@checks.customPermsOrRole("manage_server")
async def add_perms(self, ctx, *msg: str):
"""Setups up custom permissions on the provided command
"""Sets up custom permissions on the provided command
Format must be 'perms add <command> <permission>'"""
command = " ".join(msg[0:len(msg)-1])
permissions = msg[len(msg)-1]