Advertisement
Guest User

Untitled

a guest
Apr 9th, 2013
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.07 KB | None | 0 0
  1.     """
  2.    Stops the users that talk in german by telling them to talk in english.
  3.  
  4.    By: Matthew0901
  5.  
  6.    """
  7.     import string
  8.          
  9.     def apply_script(protocol, connection, config):
  10.          
  11.         class nogermanConnection(connection):
  12.             global germandict
  13.          
  14.             germandict = {
  15.     'hallo',
  16.     'alter',
  17.     'welches',
  18.     'ihr',
  19.     'angebracht',
  20.     'beim',
  21.     'seufzer',
  22.     'null',
  23.     'ich',
  24.     'ein',
  25.     'auf',
  26.     'Wiedersehen',
  27.     'dadurch',
  28.     'konnen',
  29.  
  30.     }
  31.          
  32.             def on_chat(self, value, global_message):
  33.                 message = string.lower(value)
  34.                 for punc in string.punctuation:
  35.                     message = message.replace(punc,"")
  36.                 if any(german in message for german in germandict):
  37.                     self.send_chat('Dies ist ein English Speaking Server Bitte sprechen Englisch.')
  38.                     return False
  39.                 return connection.on_chat(self, value, global_message)
  40.          
  41.         return protocol, nogermanConnection
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement