Lyend

Untitled

Sep 26th, 2012
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 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("Hey"):
  15. room.message("What are you about to annoy me with . . .")
  16. if message.body.startswith("hi"):
  17. room.message(". . What is it?")
  18. if message.body.startswith("Hi"):
  19. room.message("No, not more.")
  20. if message.body.startswith("Rawr!"):
  21. room.message("You Dare Growl at me?")
  22. if message.body.startswith("Hey."):
  23. room.message("Jauna.")
  24. if message.body.startswith("hey"):
  25. room.message("What now?")
  26. if message.body.startswith("whats up"):
  27. room.message("Teach yourself proper spelling before you get the nerve to speak to me.")
  28. if message.body.startswith("What's up"):
  29. room.message("The sky, or a ceiling. Whichever fits.")
  30. if message.body.startswith("Luna"):
  31. room.message("Use my full name please.")
  32. if message.body.startswith("Luna."):
  33. room.message("Only Astah or Vyolette may call me that.")
  34. if message.body.startswith("luna"):
  35. room.message("Names start with capital letters. Thank you.")
  36. if message.body.startswith("Lunarix."):
  37. room.message("What is it you wish for?")
  38. if message.body.startswith("Lunarix"):
  39. room.message("What do you ask of me?")
  40. if message.body.startswith("lol"):
  41. room.message("I bet you're not actually 'Laughing Out Loud'.")
  42. if message.body.startswith("Lol"):
  43. room.message("'Laughing Out Loud'? You're not really.")
  44.  
  45. def onFloodWarning(self, room):
  46. room.reconnect()
  47.  
  48. def onPMMessage(self, pm, user, body):
  49. pm.message(user, body) # echo
  50.  
  51. if __name__ == "__main__":
  52. TestBot.easy_start()
Advertisement
Add Comment
Please, Sign In to add comment