]> jfr.im git - erebus.git/blobdiff - modules/module.py
fixed bug, ctlmod.reloadmod needed to return success
[erebus.git] / modules / module.py
index 3d9b3e1aec7c9b62e8979a1f66fe8a7abca56958..bcccaa210bb58bc5deb85a26b4588fb239bf2260 100644 (file)
@@ -1,10 +1,10 @@
-# Erebus IRC bot - Author: John Runyon
-# simple module example
+# Erebus IRC bot - Author: Erebus Team
+# module control through irc
 # This file is released into the public domain; see http://unlicense.org/
 
 # module info
 modinfo = {
-       'author': 'John Runyon (DimeCadmium)',
+       'author': 'Erebus Team',
        'license': 'public domain',
        'compatible': [1], # compatible module API versions
        'depends': [], # other modules required to work properly?
@@ -41,9 +41,15 @@ def cmd_modunload(bot, user, chan, realtarget, *args):
 @lib.argsEQ(1)
 def cmd_modreload(bot, user, chan, realtarget, *args):
        okay = ctlmod.reloadmod(bot.parent, args[0])
-       bot.msg(user, "Reloaded %s" % (args[0]))
+       if okay:
+               bot.msg(user, "Reloaded %s" % (args[0]))
+       else:
+               bot.msg(user, "Error occurred: %r" % (okay))
 
 @lib.hook('modlist', needchan=False, glevel=lib.STAFF)
 @lib.argsEQ(0)
 def cmd_modlist(bot, user, chan, realtarget, *args):
-       return NotImplemented
+       mods = ctlmod.modules
+       for mod in mods.itervalues():
+               bot.msg(user, "- %s %r" % (mod.__name__, mod))
+       bot.msg(user, "Done.")