Checking the actual permissions instead of the role
This commit is contained in:
parent
645f8fa85f
commit
03dda8afc8
9
bot.py
9
bot.py
|
@ -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))
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Reference in a new issue