]>
jfr.im git - erebus.git/blob - modules/foo.py
1 # Erebus IRC bot - Author: Erebus Team
2 # simple module example
3 # This file is released into the public domain; see http://unlicense.org/
7 'author': 'Erebus Team',
8 'license': 'public domain',
9 'compatible': [1], # compatible module API versions
10 'depends': [], # other modules required to work properly?
15 lib
= modlib
.modlib(__name__
)
16 modstart
= lib
.modstart
20 @lib.hook(needchan
=False) #since no cmd= is provided, defaults to function name
21 @lib.help('<args>', 'tells you what you said')
22 def test(bot
, user
, chan
, realtarget
, *args
):
23 if chan
is not None and realtarget
== chan
.name
: replyto
= chan
26 bot
.msg(replyto
, "You said: %s" % (' '.join([str(arg
) for arg
in args
])))
28 @lib.hook(('foo', 'bar'), needchan
=False) #hooks !foo and !bar as aliases
29 @lib.help(None, 'replies with nonsense.', "it's a very non-sensical command", "more lines")
30 def foobar(bot
, user
, chan
, realtarget
, *args
):
31 bot
.msg(user
, "Foo bar baz.")