Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import string
- def apply_script(protocol, connection, config):
- class antiswearConnection(connection):
- global sweardict
- sweardict = [
- 'duck',
- 'shit',
- 'bitch',
- 'bastard',
- 'fucking',
- 'penis',
- 'deuce',
- 'deuce',
- 'asshole',
- 'dick',
- ]
- def on_chat(self, value, global_message):
- message = string.lower(value)
- for punc in string.punctuation:
- message = message.replace(punc,"")
- if any(swears in message for swears in sweardict):
- self.send_chat('Your message has been blocked. Please do not swear in this server.')
- return False
- return connection.on_chat(self, value, global_message)
- return protocol, antiswearConnection
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement