do_everything_to.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. from common.networkservices import ChanServ
  2. def join(self, connection, channel, key=False):
  3. connection.privmsg("ChanServ", "UNBAN")
  4. connection.privmsg("ChanServ", "UNBAN " + channel)
  5. ChanServ.unban(connection, channel, connection.get_nickname())
  6. ChanServ.akick_del(connection, channel, connection.get_nickname())
  7. ChanServ.invite(connection, channel)
  8. ChanServ.getkey(connection, channel)
  9. knownkey = self.db.one("SELECT key FROM channels WHERE name='" + channel + "' AND network='" + self.network + "'")
  10. if key:
  11. connection.join(channel, key)
  12. if not key == knownkey:
  13. self.channelkeys[channel] = key
  14. elif knownkey:
  15. connection.join(channel, key)
  16. else:
  17. print("executing join " + channel)
  18. connection.join(channel)
  19. def unban(connection, channel, user, mask):
  20. ChanServ.unban(connection, channel, user)
  21. connection.mode(channel, "-b " + mask)
  22. def ban(connection, channel, user, mask, reason):
  23. ChanServ.ban(connection, channel, user, reason)
  24. connection.mode(channel, "+b " + mask)
  25. def kick(connection, channel, user, reason):
  26. ChanServ.kick(connection, channel, user, reason)
  27. connection.kick(channel, user, reason)
  28. def bankick(connection, channel, user, mask, reason):
  29. ban(connection, channel, user, mask, reason)
  30. kick(connection, channel, user, reason)