1
0

on_welcome.py 845 B

123456789101112131415161718
  1. from common import log, do_everything_to, queries
  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. # Identify with NickServ.
  6. if self.network.password: # Password saved.
  7. connection.privmsg("NickServ", "identify " + self.network.password) # Identify with NickServ.
  8. connection.mode(connection.get_nickname(), "+x")
  9. do_everything_to.join(self, connection, self.network.home_channel) # Join home channel.
  10. # Join channels with the autojoin setting.
  11. channels = queries.get_autojoin_channels(self) # Get channels with autojoin setting.
  12. for channel in channels:
  13. connection.join(channel) # Join channels with autojoin function.