| 123456789101112131415161718192021222324252627 |
- from common import log, do_everything_to, queries
- def process_event(self, connection, event):
- log.info(event) # Log event.
- self.db.run("UPDATE rotbot_host SET connection_succeeds = connection_succeeds + 1 WHERE id=%s", [self.network.id])
- # Identify with network services.
- if self.network.services == 'm': # Modern network services (NickServ, ChanServ & MemoServ)
- if self.network.password: # Password saved.
- connection.privmsg("NickServ", "identify " + self.network.password) # Identify with NickServ.
- if self.network.services == 'x': # X bot.
- self.xbot = 'x@xhannels.%s' % '.'.join(event.source.split('.')[-2:])
- if self.network.password: # Password saved.
- print(self.xbot + ' LOGIN %s %s' % (self.network.nickname, self.network.password))
- connection.privmsg(self.xbot, 'LOGIN %s %s' % (self.network.nickname, self.network.password)) # Identify with X.
- connection.mode(connection.get_nickname(), "-x")
- do_everything_to.join(self, connection, self.network.home_channel) # Join home channel.
- # Join channels with the autojoin setting.
- channels = queries.get_autojoin_channels(self) # Get channels with autojoin setting.
- log.info('Joining autojoin channels: %s' % channels)
- for channel in channels:
- connection.join(channel) # Join channels with autojoin function.
- #connection.privmsg('NickServ', 'ACCESS LIST') # Request access list from NickServ.
|