Added basic support for permission_level on the commands
parent
3892debb02
commit
42d958d22d
|
@ -113,8 +113,9 @@ class GeoffreyBot(commands.Bot):
|
||||||
command_args = ''
|
command_args = ''
|
||||||
|
|
||||||
await self.send_error_message(
|
await self.send_error_message(
|
||||||
'Geoffrey encountered unhandled exception: {} Command: **{}** Context: {}'
|
'Geoffrey encountered unhandled exception: {} Command: **{}** Context: {}'.format(error,
|
||||||
.format(error, ctx.invoked_with, command_args))
|
ctx.invoked_with,
|
||||||
|
command_args))
|
||||||
|
|
||||||
error_message = ["```python"]
|
error_message = ["```python"]
|
||||||
for tb in traceback.format_tb(error.original.__traceback__):
|
for tb in traceback.format_tb(error.original.__traceback__):
|
||||||
|
@ -184,20 +185,21 @@ class GeoffreyBot(commands.Bot):
|
||||||
help_list = []
|
help_list = []
|
||||||
largest_command_size = 0
|
largest_command_size = 0
|
||||||
for command in self.command_list:
|
for command in self.command_list:
|
||||||
|
if command["permission_level"] == "PLAYER":
|
||||||
if largest_command_size < len(command["command"]):
|
if largest_command_size < len(command["command"]):
|
||||||
largest_command_size = len(command["command"])
|
largest_command_size = len(command["command"])
|
||||||
|
|
||||||
for line in self.description.split("\n"):
|
for line in self.description.split("\n"):
|
||||||
help_list.append(line)
|
help_list.append(line)
|
||||||
|
|
||||||
help_list.append("\nCommands:")
|
help_list.append("\n**__Commands:__**")
|
||||||
for command in self.command_list:
|
for command in self.command_list:
|
||||||
name = command["command"].ljust(largest_command_size + 2)
|
if command["permission_level"] == "PLAYER":
|
||||||
help_list.append(" {}{}{}".format(self.prefix, name, command["help"]))
|
name = command["command"]
|
||||||
|
help_list.append("**{}{}** - {}".format(self.prefix, name, command["help"]))
|
||||||
|
|
||||||
help_list.append("\nDo ?help <command name> to get more info on any of the commands above")
|
help_list.append("\nDo ?help <command name> to get more info on any of the commands above")
|
||||||
|
|
||||||
|
|
||||||
return help_list
|
return help_list
|
||||||
|
|
||||||
def build_help_dict(self):
|
def build_help_dict(self):
|
||||||
|
|
Loading…
Reference in New Issue