diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2010-05-09 21:49:15 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2010-05-09 21:49:15 +0200 |
commit | 1384d1976fa984b6b254c93677363f67944c0c7a (patch) | |
tree | 698faff3ef045df7f2a8e3bd75e6b1e04a397b28 /modules/help.py | |
parent | e5cd4bb20328110561ee9956f948b97c378cf671 (diff) | |
download | curunir-1384d1976fa984b6b254c93677363f67944c0c7a.tar curunir-1384d1976fa984b6b254c93677363f67944c0c7a.zip |
Made everything much more error resistant
Diffstat (limited to 'modules/help.py')
-rw-r--r-- | modules/help.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/help.py b/modules/help.py index ed3e4d3..99f05a4 100644 --- a/modules/help.py +++ b/modules/help.py @@ -1,4 +1,4 @@ -from base import ModuleBase +from . import ModuleBase import re class Module(ModuleBase): @@ -12,8 +12,8 @@ class Module(ModuleBase): if not re.match(r'!help(?:\W|\Z)', text): return - commands = reduce(lambda l, mod: l + mod.commands(), self.manager.modules.itervalues(), []) + commands = self.manager.commands() 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(), [])) + helptexts = '\n'.join(self.manager.helptexts()) handler.reply(('Befehle:\n' + helpstring + '\n' + helptexts).strip()) |