class HelpModule:
	def __init__(self, circa):
		self.circa = circa
		self.events = {
			"cmd.help": [self.help]
		}
		self.docs = {
			"help": "help [<module>[.<command>]] → show usage info for a command, or list all commands in a module, or list all modules"
		}

	def help(self, fr, to, msg, m):
		msg = msg.split(" ", 1)[0]
		if msg:
			c = msg.split(".", 1)
			module = self.circa.modules[c[0]]
			if len(c) == 1: # module
				if isinstance(module.docs, dict):
					commands = sorted(module.docs.keys())
					self.circa.say(to, "Available commands: " + " ".join(commands))
				else:
					# in this case the module likely doesn't offer plain commands
					self.circa.say(to, str(module.docs))
			else: # command
				command = module.docs[c[1]]
				self.circa.say(to, self.circa.conf["prefix"] + command)
		else:
			modules = sorted([i for i in self.circa.modules.keys() if \
				hasattr(self.circa.modules[i], "docs")])
			self.circa.say(to, "Available modules: " + " ".join(modules))

module = HelpModule

@@ -291,16 +291,50 @@
 sg, m):%0A
+%09%09pfx = self.circa.conf%5B%22prefix%22%5D%0A
 %09%09msg = 
@@ -354,16 +354,16 @@
 , 1)%5B0%5D%0A
-
 %09%09if msg
@@ -515,16 +515,38 @@
  sorted(
+%5Bpfx + cmd for cmd in 
 module.d
@@ -555,16 +555,17 @@
 s.keys()
+%5D
 )%0A%09%09%09%09%09s
@@ -566,38 +566,41 @@
 %09%09%09%09%09self.circa.
-say(to
+notice(fr
 , %22Available com
@@ -603,32 +603,33 @@
  commands: %22 + %22
+,
  %22.join(commands
@@ -631,16 +631,109 @@
 mands))%0A
+%09%09%09%09%09self.circa.notice(fr, %22Type %7B0%7Dhelp %7B1%7D.%3Ccommand%3E for command help.%22.format(pfx, c%5B0%5D))%0A
 %09%09%09%09else
@@ -817,22 +817,25 @@
 f.circa.
-say(to
+notice(fr
 , str(mo
@@ -916,41 +916,22 @@
 rca.
-say(to, self.circa.conf%5B%22prefix%22%5D
+notice(fr, pfx
  + c
@@ -1072,14 +1072,17 @@
 rca.
-say(to
+notice(fr
 , %22A
@@ -1104,16 +1104,17 @@
 s: %22 + %22
+,
  %22.join(
@@ -1122,16 +1122,102 @@
 odules))
+%0A%09%09%09self.circa.notice(fr, %22Type %7B0%7Dhelp %3Cmodule%3E for a list of commands.%22.format(pfx))
 %0A%0Amodule

move PRIVMSGs to NOTICEs