]> jfr.im git - irc/evilnet/x3.git/blame_incremental - src/plugins/annoy/plugin.py
update test python plugin
[irc/evilnet/x3.git] / src / plugins / annoy / plugin.py
... / ...
CommitLineData
1# anoy module
2
3import svc
4
5class Annoy:
6
7 def __init__(self, handler, irc):
8 self.handler = handler
9 self.name = "annoy"
10
11# irc.send_target_privmsg("O3", "#TheOPS", "%s is loaded"%self.name)
12# handler.addhook("join", self.on_join, "foobar")
13 handler.addcommand(self.name, "dance", self.dance)
14 self.test = "footest"
15
16# def on_join(self, irc, channel, nick):
17# irc.send_target_privmsg("x3", channel, "%s joined %s:%s "%(nick, channel, self.test))
18
19 def dance(self, irc, args):
20 nick = irc.caller
21 user = svc.get_user(nick)
22
23 reply = "Ok,"
24 if(user and "account" in user):
25 reply += " Mr. %s"%user["account"]
26
27 reply += " we can dance"
28 if(len(args)):
29 reply += " "
30 reply += args
31 reply += "."
32
33 irc.reply(reply)
34
35Class = Annoy