]>
Commit | Line | Data |
---|---|---|
07559983 AS |
1 | # anoy module |
2 | ||
3 | import svc | |
4 | ||
5 | class Annoy: | |
6 | ||
7 | def __init__(self, handler, irc): | |
8 | self.handler = handler | |
9 | self.name = "annoy" | |
10 | ||
0bcdc113 AS |
11 | # irc.send_target_privmsg("O3", "#TheOPS", "%s is loaded"%self.name) |
12 | # handler.addhook("join", self.on_join, "foobar") | |
07559983 AS |
13 | handler.addcommand(self.name, "dance", self.dance) |
14 | self.test = "footest" | |
15 | ||
0bcdc113 AS |
16 | # def on_join(self, irc, channel, nick): |
17 | # irc.send_target_privmsg("x3", channel, "%s joined %s:%s "%(nick, channel, self.test)) | |
07559983 AS |
18 | |
19 | def dance(self, irc, args): | |
0bcdc113 AS |
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) | |
07559983 AS |
34 | |
35 | Class = Annoy |