]> jfr.im git - z_archive/Ophion.git/blob - modules/sample.py
Initialize repo
[z_archive/Ophion.git] / modules / sample.py
1 from classes import *
2 from util import *
3
4 name = 'foobar'
5 author = 'John Runyon'
6 version = '1'
7 def init(cache):
8 cache.currmod = __name__
9 #cache.hookcmd('COMMAND',level,cmdfn,params,helpfn,isadmin=False,reqchan=True)
10 cache.hookcmd('FOO', 0, foo, 0, helpfoo)
11 cache.hookcmd('BAR', 1, bar, 0, helpbar, isadmin=True)
12 cache.hookcmd('BAZ', 0, baz, 0, helpbaz, reqchan=False)
13 cache.hookcmd('HELLO', 0, hello, 1, helphello)
14 def deinit(cache, reloading=False):
15 cache.currmod = __name__
16 cache.unhookcmd('FOO')
17 cache.unhookcmd('BAR')
18 cache.unhookcmd('BAZ')
19 cache.unhookcmd('HELLO')
20
21 def foo(nick, target, params, bot, cache):
22 bot.msg(nick, "Foo to you too! (nick)")
23 bot.msg(target, "Foo to you too! (target)")
24 def bar(nick, target, params, bot, cache):
25 bot.msg(nick, "Bar to you too! (nick)")
26 bot.msg(target, "Bar to you too! (target)")
27 def baz(nick, target, params, bot, cache):
28 bot.msg(nick, "Baz to you too! (nick)")
29 bot.msg(target, "Baz to you too! (target)")
30 def hello(nick, target, params, bot, cache):
31 bot.msg(nick, "Hello, %s! (nick)" % (params))
32 bot.msg(target, "Hello, %s! (target" % (params))
33
34 # ['COMMAND <params>', 'Help description']
35 def helpfoo(): return ['FOO <#channel>', "'FOO', 0, foo, 0, helpfoo"]
36 def helpbar(): return ['BAR', "'BAR', 1, bar, 0, helpbar, isadmin=True"]
37 def helpbaz(): return ['BAZ', "'BAZ', 0, baz, 0, helpbaz, reqchan=False"]
38 def helphello(): return ['HELLO', "'HELLO', 0, hello, 1, helphello"]