Checking the actual permissions instead of the role
This commit is contained in:
parent
645f8fa85f
commit
03dda8afc8
2 changed files with 6 additions and 5 deletions
9
bot.py
9
bot.py
|
@ -63,10 +63,11 @@ async def on_command_error(error, ctx):
|
||||||
elif isinstance(error, commands.CheckFailure):
|
elif isinstance(error, commands.CheckFailure):
|
||||||
fmt = "You can't tell me what to do!"
|
fmt = "You can't tell me what to do!"
|
||||||
await bot.send_message(ctx.message.channel, fmt)
|
await bot.send_message(ctx.message.channel, fmt)
|
||||||
#elif isinstance(error, commands.CommandInvokeError):
|
elif isinstance(error, commands.CommandInvokeError):
|
||||||
#print('In {0.command.qualified_name}:'.format(ctx), file=sys.stderr)
|
f = open("/home/phxntx5/public_html/Bonfire/error_log", 'w')
|
||||||
#traceback.print_tb(error.original.__traceback__)
|
print('In {0.command.qualified_name}:'.format(ctx), file=f)
|
||||||
#print('{0.__class__.__name__}: {0}'.format(error.original), file=sys.stderr)
|
traceback.print_tb(error.original.__traceback__, file=f)
|
||||||
|
print('{0.__class__.__name__}: {0}'.format(error.original), file=f)
|
||||||
else:
|
else:
|
||||||
fmt = 'An error occurred while processing this request: ```py\n{}: {}\n```'
|
fmt = 'An error occurred while processing this request: ```py\n{}: {}\n```'
|
||||||
await bot.send_message(ctx.message.channel, fmt.format(type(error).__name__, error))
|
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)
|
@perms.command(name="add", aliases=["setup,create"], pass_context=True)
|
||||||
@checks.customPermsOrRole("manage_server")
|
@checks.customPermsOrRole("manage_server")
|
||||||
async def add_perms(self, ctx, *msg: str):
|
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>'"""
|
Format must be 'perms add <command> <permission>'"""
|
||||||
command = " ".join(msg[0:len(msg)-1])
|
command = " ".join(msg[0:len(msg)-1])
|
||||||
permissions = msg[len(msg)-1]
|
permissions = msg[len(msg)-1]
|
||||||
|
|
Loading…
Reference in a new issue