From 323d31514f7e438df5883ad6cb9e17cce6a296b3 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 2 May 2010 23:40:21 +0200 Subject: Added topic module --- modules/help.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'modules/help.py') diff --git a/modules/help.py b/modules/help.py index 71d1a56..ed3e4d3 100644 --- a/modules/help.py +++ b/modules/help.py @@ -8,11 +8,12 @@ class Module(ModuleBase): 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): + def groupchat(self, room, nick, text, handler): + if not re.match(r'!help(?:\W|\Z)', text): return commands = reduce(lambda l, mod: l + mod.commands(), self.manager.modules.itervalues(), []) helpstring = reduce(lambda s, (c, h): s + c + ': ' + h + '\n', commands, '') + helptexts = '\n'.join(reduce(lambda l, mod: l + mod.helptexts(), self.manager.modules.itervalues(), [])) - reply('Befehle:\n\n' + helpstring) + handler.reply(('Befehle:\n' + helpstring + '\n' + helptexts).strip()) -- cgit v1.2.3