on_welcome.py 713 B

123456789101112
  1. from common import log, do_everything_to
  2. def process_event(self, connection, event):
  3. log.info(event) # Handy for debugging. Keep this.
  4. if self.password: # Id with NickServ
  5. connection.privmsg("NickServ", "identify " + connection.nickname + " " + self.password) # Identify with NickServ.
  6. channels = self.db.all("SELECT name FROM channels WHERE network='" + self.network + "' AND autojoin=True")
  7. connection.join(self.homechannel)
  8. for channel in channels: # Join channels with autojoin function.
  9. connection.join(channel)
  10. do_everything_to.join(self, connection, self.homechannel)
  11. connection.who(connection.get_nickname()) # Get whoreply to add bot to protectees.