1
0

on_welcome.py 971 B

123456789101112131415161718192021
  1. from common import log, do_everything_to, queries
  2. def process_event(self, connection, event):
  3. log.info(event) # Log event.
  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. log.info('Joining autojoin channels: %s' % channels)
  13. for channel in channels:
  14. connection.join(channel) # Join channels with autojoin function.
  15. connection.privmsg('NickServ', 'ACCESS LIST') # Request access list from NickServ.