command = None
if command is None:
+ valid_commands = ['coords', 'close_to', 'distance', 'edts', 'find', 'fuel_usage', 'galmath', 'id', 'raikogram', 'time']
+ valid_commands += plugins.valid_commands()
lines = [
'<@{}>, the cat-like robot from the 34th century of the future, recognises these commands (and more):'.format(client.user.id),
- '```',
- 'announce',
- 'coords',
- 'bling',
- 'close_to',
- 'distance',
- 'edts',
- 'find',
- 'fuel_usage',
- 'galmath',
- 'id',
- 'raikogram',
- 'time',
+ '```'
+ ]
+ lines += sorted(valid_commands)
+ lines += [
'```',
'Send `help COMMAND` for help on a specific command.'
]
def plugins(self):
return self.loaded.keys()
+ def valid_commands(self):
+ commands = []
+ for name in self.plugins():
+ plugin_commands = self.call_method(name, 'valid_commands')
+ if plugin_commands is not None:
+ commands += plugin_commands
+ return sorted(list(set(commands)))
+
def description(self, name):
if self.has_method(name, 'description'):
return self.call_method(name, 'description')