SHARE
TWEET

Untitled

a guest Apr 9th, 2013 32 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import string
  2.  
  3. def apply_script(protocol, connection, config):
  4.  
  5. class antiswearConnection(connection):
  6. global sweardict
  7.  
  8. sweardict = [
  9. 'duck',
  10. 'shit',
  11. 'bitch',
  12. 'bastard',
  13. 'fucking',
  14. 'penis',
  15. 'deuce',
  16. 'deuce',
  17. 'asshole',
  18. 'dick',
  19. ]
  20.  
  21. def on_chat(self, value, global_message):
  22. message = string.lower(value)
  23. for punc in string.punctuation:
  24. message = message.replace(punc,"")
  25. if any(swears in message for swears in sweardict):
  26. self.send_chat('Your message has been blocked. Please do not swear in this server.')
  27. return False
  28. return connection.on_chat(self, value, global_message)
  29.  
  30. return protocol, antiswearConnection
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top