]>
Commit | Line | Data |
---|---|---|
00823c25 | 1 | # Erebus IRC bot - Author: Erebus Team |
db75daab JR |
2 | # simple module example |
3 | # This file is released into the public domain; see http://unlicense.org/ | |
4 | ||
28d7d32f JR |
5 | # module info |
6 | modinfo = { | |
00823c25 | 7 | 'author': 'Erebus Team', |
28d7d32f JR |
8 | 'license': 'public domain', |
9 | 'compatible': [1], # compatible module API versions | |
10 | 'depends': [], # other modules required to work properly? | |
11 | } | |
12 | ||
5c6c0839 JR |
13 | # preamble |
14 | import modlib | |
15 | lib = modlib.modlib(__name__) | |
16 | modstart = lib.modstart | |
d1ea05b0 | 17 | modstop = lib.modstop |
5c6c0839 | 18 | |
28d7d32f | 19 | # module code |
444eb517 JR |
20 | @lib.hook('test', needchan=False) |
21 | def cmd_gtest(bot, user, chan, realtarget, *args): | |
22 | if chan is not None: replyto = chan | |
23 | else: replyto = user | |
24 | ||
f4bab9d7 | 25 | bot.msg(replyto, "You said: %s" % (' '.join([str(arg) for arg in args]))) |