]> jfr.im git - irc/rizon/acid.git/blob - pyva/src/main/python/registration/registration.py
Import acidictive 4 and pyva plugin
[irc/rizon/acid.git] / pyva / src / main / python / registration / registration.py
1 #!/usr/bin/python pseudoserver.py
2 # psm_registration.py
3 # module for pypseudoserver
4 # written by B (ben@rizon.net)
5 # helpful registration bot!
6
7 from pyva import *
8 import logging
9 from core import *
10 from plugin import *
11
12 class registration(AcidPlugin):
13 def __init__(self):
14 AcidPlugin.__init__(self)
15
16 self.name = "registration"
17 self.log = logging.getLogger(__name__)
18
19 def start(self):
20 self.client = self.config.get('registration', 'nick')
21 return True
22
23 def onChanModes(self, prefix, chan, modes):
24 if modes != "+z":
25 return #ignore all other mode changes, we only want +z for starts
26
27 me = self.inter.findUser(self.client)
28 if not me:
29 return
30
31 user = self.inter.findUser(prefix)
32 if not user or user.getNick() != 'ChanServ':
33 return
34
35 self.log.debug("Caught a channel registration")
36
37 me.joinChan(chan)
38
39
40 #s XXX lol?
41 self.inter.privmsg(self.client, chan, self.config.get('registration', 'reg1'))
42 self.inter.privmsg(self.client, chan, self.config.get('registration', 'reg2'))
43 self.inter.privmsg(self.client, chan, self.config.get('registration', 'reg3'))
44 self.inter.privmsg(self.client, chan, self.config.get('registration', 'reg4'))
45 self.inter.privmsg(self.client, chan, self.config.get('registration', 'reg5'))
46 self.inter.privmsg(self.client, chan, self.config.get('registration', 'reg6'))
47
48 #logging fun
49 self.inter.privmsg(self.client, self.logchan, "registration info sent to %s" % chan)
50
51 me.partChan(chan)