]>
jfr.im git - irc/evilnet/x3.git/blob - src/plugins/annoy/plugin.py
7 def __init__(self
, handler
, irc
):
11 # These hooks are for testing, and are commented out by default so as not to annoy
12 # us unless we want to test them
13 #handler.addhook("join", self.on_join, "foobar")
14 #handler.addhook("nick_change", self.nick_change, ["Rubin", None], "testing")
16 handler
.addcommand(self
.name
, "dance", self
.dance
)
17 handler
.addcommand(self
.name
, "nickof", self
.nickof
)
20 # def on_join(self, irc, channel, nick):
21 # irc.send_target_privmsg("x3", channel, "%s joined %s:%s "%(nick, channel, self.test))
23 def nick_change(self
, irc
, nick
, old_nick
):
24 svcinfo
= _svc
.get_info()
25 # opserv pm #theops that someones nick changed
26 irc
.send_target_privmsg(svcinfo
["opserv"], "#theops", "%s changed nick to %s"%(old_nick
, nick
) )
28 def dance(self
, irc
, args
):
30 user
= _svc
.get_user(nick
)
33 if(user
and "account" in user
):
34 reply
+= " Mr. %s"%user["account"]
36 reply
+= " we can dance"
44 def nickof(self
, irc
, bot
):
45 info
= _svc
.get_info()
47 if(bot
and bot
in info
.keys()):
48 irc
.reply("%s has nick %s"%(bot
, info
[bot
]))
50 irc
.reply("I dunno. Try %s"%str
(info
.keys()))