X-Git-Url: https://jfr.im/git/erebus.git/blobdiff_plain/58401d098f1e48416cf01b87b31e6ab2c9725f57..b091071713e832e6c007e57b49d68e2a3b54f0ed:/modules/help.py?ds=sidebyside diff --git a/modules/help.py b/modules/help.py index ff64cf0..299cf0a 100644 --- a/modules/help.py +++ b/modules/help.py @@ -80,7 +80,7 @@ class HelpLine(object): @lib.hook(needchan=False) @lib.help('[]', 'lists commands or describes a command') -def help(bot, user, chan, realtarget, *args): #TODO add ordering - by access level, then alphabetic? +def help(bot, user, chan, realtarget, *args): if len(args) == 0: # list commands lines = [] for func in helps.itervalues(): @@ -91,16 +91,15 @@ def help(bot, user, chan, realtarget, *args): #TODO add ordering - by access lev lines.append(HelpLine(c, "", "Alias of %s" % (func.cmd[0]), (user.glevel > 0), func.reqglevel, func.__module__)) for line in sorted(lines): bot.slowmsg(user, str(line)) + bot.slowmsg(user, "End of command listing.") else: # help for a specific command/topic cmd = str(' '.join(args)) if cmd in cmds and user.glevel >= cmds[cmd].reqglevel: func = cmds[cmd] - if func.reqglevel <= 0: - bot.slowmsg(user, "%-40s - %-50s" % (func.cmd[0]+' '+func.syntax, func.shorthelp)) - else: - bot.slowmsg(user, "%-40s - %-50s (%5s)" % (func.cmd[0]+' '+func.syntax, func.shorthelp, func.reqglevel)) + bot.slowmsg(user, str(HelpLine(func.cmd[0], func.syntax, func.shorthelp, (user.glevel > 0), func.reqglevel, func.__module__))) for line in func.longhelps: bot.slowmsg(user, " %s" % (line)) + bot.slowmsg(user, "End of help for %s." % (func.cmd[0])) if len(func.cmd) > 1: bot.slowmsg(user, " Aliases: %s" % (' '.join(func.cmd[1:])))