Lyend

Untitled

Mar 2nd, 2013
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.68 KB | None | 0 0
  1. import ch
  2. class TestBot(ch.RoomManager):
  3.   def onConnect(self, room):
  4.     print("Connected")
  5.    
  6.   def onReconnect(self, room):
  7.     print("Reconnected")
  8.    
  9.   def onDisconnect(self, room):
  10.     print("Disconnected")
  11.  
  12.   def onMessage(self, room, user, message):
  13.     print(user.name+":"+message.body)
  14.     if message.body.startswith("If this exactly is sent"):
  15.       room.message("This is what is said")
  16.      
  17.   def onFloodWarning(self, room):
  18.     room.reconnect()
  19.  
  20.   def onPMMessage(self, pm, user, body):
  21.     pm.message(user, body) # Notes, I should put something legit here.
  22.  
  23. if __name__ == "__main__":
  24.   TestBot.easy_start(name = None, password = None, pm = True)
Advertisement
Add Comment
Please, Sign In to add comment