on_welcome.py 766 B

12345678910111213
  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.mode(connection.get_nickname(), "+x")
  8. connection.join(self.homechannel)
  9. for channel in channels: # Join channels with autojoin function.
  10. connection.join(channel)
  11. do_everything_to.join(self, connection, self.homechannel)
  12. connection.who(connection.get_nickname()) # Get whoreply to add bot to protectees.