|
@@ -22,10 +22,19 @@ class Help(BaseCommand): |
|
|
if not data.args: |
|
|
if not data.args: |
|
|
self.do_general_help(data) |
|
|
self.do_general_help(data) |
|
|
else: |
|
|
else: |
|
|
self.do_command_help(data) |
|
|
|
|
|
|
|
|
if data.args[0] == "list": |
|
|
|
|
|
self.do_list_help(data) |
|
|
|
|
|
else: |
|
|
|
|
|
self.do_command_help(data) |
|
|
|
|
|
|
|
|
def do_general_help(self, data): |
|
|
def do_general_help(self, data): |
|
|
self.connection.reply(data, "I am a bot! You can get help for any command by typing '!help <command>'.") |
|
|
|
|
|
|
|
|
self.connection.reply(data, "I am a bot! You can get help for any command with '!help <command>', or a list of all loaded modules with '!help list'.") |
|
|
|
|
|
|
|
|
|
|
|
def do_list_help(self, data): |
|
|
|
|
|
commands = command_handler.get_commands() |
|
|
|
|
|
cmnds = map(lambda c: c.__class__.__name__, commands) |
|
|
|
|
|
pretty_cmnds = ', '.join(cmnds) |
|
|
|
|
|
self.connection.reply(data, "%s command classes loaded: %s." % (len(cmnds), pretty_cmnds)) |
|
|
|
|
|
|
|
|
def do_command_help(self, data): |
|
|
def do_command_help(self, data): |
|
|
command = data.args[0] |
|
|
command = data.args[0] |
|
|