summaryrefslogtreecommitdiffstats
path: root/modules/help.py
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2010-05-02 20:28:17 +0200
committerMatthias Schiffer <matthias@gamezock.de>2010-05-02 20:31:34 +0200
commit0277a779c9dff841e04a08a5c39fe07faa92cfe8 (patch)
tree6a935f30a31a925c2c404dbbc119040b3b9e0acd /modules/help.py
parent41fec54c305d4a81245e9e294c7fc29fed9b7b00 (diff)
downloadcurunir-0277a779c9dff841e04a08a5c39fe07faa92cfe8.tar
curunir-0277a779c9dff841e04a08a5c39fe07faa92cfe8.zip
Added modules
Diffstat (limited to 'modules/help.py')
-rw-r--r--modules/help.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/modules/help.py b/modules/help.py
new file mode 100644
index 0000000..d239f84
--- /dev/null
+++ b/modules/help.py
@@ -0,0 +1,18 @@
+from base import ModuleBase
+import re
+
+class Module(ModuleBase):
+ def __init__(self, manager):
+ ModuleBase.__init__(self, manager)
+
+ def commands(self):
+ return [('!help', 'Zeigt diese Hilfe an...')]
+
+ def groupchat(self, room, message_from, message_body, reply):
+ if not re.match(r'!help(?:\W|\Z)', message_body):
+ return
+
+ commands = reduce(lambda l, mod: l + mod.commands(), self.manager.modules, [])
+ helpstring = reduce(lambda s, (c, h): s + c + ': ' + h + '\n', commands, '')
+
+ reply('Befehle:\n\n' + helpstring)