+ bot.slowmsg(user, "No help found for %s" % (cmd))
+
+@lib.hook(needchan=False)
+@lib.help(None, "provides command list")
+def showcommands(bot, user, chan, realtarget, *args):
+ if bool(int(bot.parent.cfg.get('help', 'autogen', default=0))):
+ try:
+ _genhelp(bot, user, chan, realtarget, *args)
+ except: pass
+
+ url = bot.parent.cfg.get('help', 'url', default=None)
+ if url is None:
+ try:
+ import urllib2
+ myip = urllib2.urlopen("https://api.ipify.org").read()
+ url = "http://%s/help/%%d.txt (maybe)" % (myip)
+ except: url = None
+ if url is not None:
+ url = url % (user.glevel)
+ bot.msg(user, "Help is at: %s" % (url))
+ else:
+ bot.msg(user, "I don't know where help is. Sorry. Contact my owner.")
+
+#@lib.hook(needchan=False)
+#@lib.help('[@<module>|<command>]', 'lists commands or describes a command', 'with @<module>, lists all commands in <module>')
+def help_nolag(bot, user, chan, realtarget, *args):
+ if len(args) == 0: # list commands
+ lines = []
+ for func in helps.itervalues():
+ lines += _mkhelp(user, func)
+ for line in sorted(lines):
+ bot.slowmsg(user, str(line))
+ bot.slowmsg(user, "End of command listing.")
+ elif args[0].startswith("@"):
+ lines = []
+ mod = args[0][1:].lower()
+ for func in helps.itervalues():
+ if func.module == mod:
+ lines += _mkhelp(user, func)
+ 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)).lower()