X-Git-Url: https://jfr.im/git/erebus.git/blobdiff_plain/ea3909b57e527c81e9a0b8eea98ab92e026a99d5..36411de919ae2db1ff5b5376e11739c464cec7ae:/modules/foo.py diff --git a/modules/foo.py b/modules/foo.py index 3da5d62..9dbf29f 100644 --- a/modules/foo.py +++ b/modules/foo.py @@ -1,10 +1,10 @@ -# Erebus IRC bot - Author: John Runyon +# Erebus IRC bot - Author: Erebus Team # simple module example # 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? @@ -17,6 +17,9 @@ modstart = lib.modstart modstop = lib.modstop # module code -@lib.hook('test') -def cmd_test(bot, user, chan, realtarget, *args): - bot.msg(chan, "You said: %s" % (' '.join([str(arg) for arg in args]))) +@lib.hook('test', needchan=False) +def cmd_gtest(bot, user, chan, realtarget, *args): + if realtarget == chan.name: replyto = chan + else: replyto = user + + bot.msg(replyto, "You said: %s" % (' '.join([str(arg) for arg in args])))