1
0

on_welcome.py 769 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. self.db.run("UPDATE rotbot_host SET connection_succeeds = connection_succeeds + 1 WHERE id=%s", [self.network.id])
  5. if self.network.password: # Id with NickServ
  6. connection.privmsg("NickServ", "identify " + self.network.password) # Identify with NickServ.
  7. #channels = self.db.all("SELECT name FROM rotbot_channels WHERE network='" + self.network.id + "' AND autojoin=True")
  8. connection.mode(connection.get_nickname(), "+x")
  9. do_everything_to.join(self, connection, self.network.home_channel)
  10. #for channel in channels: # Join channels with autojoin function.
  11. # connection.join(channel)