do_everything_to.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. connection.join(channel)
  18. def unban(connection, channel, user, mask):
  19. ChanServ.unban(connection, channel, user)
  20. connection.mode(channel, "-b " + mask)
  21. def ban(connection, channel, user, mask, reason):
  22. ChanServ.ban(connection, channel, user, reason)
  23. connection.mode(channel, "+b " + mask)
  24. def banhost(connection, channel, mask, reason):
  25. ChanServ.ban(connection, channel, mask, reason)
  26. connection.mode(channel, "+b " + mask)
  27. def kick(connection, channel, user, reason):
  28. ChanServ.kick(connection, channel, user, reason)
  29. connection.kick(channel, user, reason)
  30. def bankick(connection, channel, user, mask, reason):
  31. ban(connection, channel, user, mask, reason)
  32. kick(connection, channel, user, reason)