@lib.hook(needchan=False)
@lib.help('[<command>]', 'lists commands or describes a command')
@lib.hook(needchan=False)
@lib.help('[<command>]', '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):
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))
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))
else: # help for a specific command/topic
cmd = str(' '.join(args))
if cmd in cmds and user.glevel >= cmds[cmd].reqglevel:
func = cmds[cmd]
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))
for line in func.longhelps:
bot.slowmsg(user, " %s" % (line))