told.py 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. from event import Event
  2. import random
  3. class Told:
  4. def __init__(self, events=None, printer_handle=None, bot=None, say=None):
  5. self.events = events
  6. self.printer = printer_handle
  7. self.interests = ['__.told__']
  8. self.bot = bot
  9. self.say = say
  10. told = Event("__.told__")
  11. told.define(msg_definition="^\.told")
  12. told.subscribe(self)
  13. self.bot.register_event(told, self)
  14. self.help = ".told <nick>"
  15. def get_told_status(self, target):
  16. """Randomly selects and returns a string with a "told" status."""
  17. status = ["FUCKING TOLD",
  18. "CASH4TOLD.COM",
  19. "KNIGHTS OF THE TOLD REPUBLIC",
  20. "STONE TOLD STEVE AUSTIN",
  21. "CURE FOR THE COMMON TOLD",
  22. "BEN TOLDS FIVE",
  23. "THE 40 YEAR TOLD VIRGIN",
  24. "TOLDENEYE 007",
  25. "TEXAS TOLD'EM",
  26. "AUSTIN POWERS IN TOLDMEMBER",
  27. "PTERODACTOLD",
  28. "NO COUNTRY FOR TOLD MEN",
  29. "24 CARAT TOLD RING",
  30. "ONLY SHOOTING STARS BREAK THE TOLD",
  31. "GOING ONCE...GOING TWICE...TOLD!",
  32. "GARY TOLDMAN",
  33. "TOLD SPICE",
  34. "TOLD STONE CREAMERY",
  35. "BABY IT'S TOLD OUTSIDE",
  36. "POKEMON TOLD AND SILVER",
  37. "TOLD YELLER",
  38. "EL DORADO: THE LOST CITY OF TOLD",
  39. "TOLDPLAY",
  40. "BATMAN: THE BRAVE AND THE TOLD",
  41. "DANNY DEVITOLD",
  42. "FOR WHOM THE BELL TOLDS",
  43. "CAN'T TEACH A TOLD DOG NEW TRICKS",
  44. "I AIN'T SAYING SHE A TOLD DIGGER",
  45. "THE TOLDEN COMPASS",
  46. "TOLDIER OF FORTUNE",
  47. "TOLDING CHAIR",
  48. "TOLDEN AXE",
  49. "TOLD MACDONALD HAD A FARM",
  50. "TOLDEN TOLDIES: HITS FROM THE 50'S, 60'S, AND 70'S",
  51. "BATTLETOLDS",
  52. "YE TOLDE PUB",
  53. "TOLDEN CAULFIELD",
  54. "THE TOLD MAN AND THE SEA",
  55. "TOLD MEDAL WINNER IN THE WINTER OLYMPICS",
  56. "POT OF TOLD AT THE END OF THE RAINBOW",
  57. "J.R.R. TOLDKIEN",
  58. "CALIFORNIA TOLD RUSH",
  59. "THERE'S TOLD IN THEM THAR HILLS"
  60. ]
  61. exclamation = ["Damn!",
  62. "Damn, son!",
  63. "Snap!",
  64. "Sheeeiiiiittttt.",
  65. "Ouch!"
  66. ]
  67. return random.choice(exclamation) + " %s\'s told status: [X] " % target + random.choice(status)
  68. def handle(self, event):
  69. _z = str.split(event.msg, None, 1)
  70. try:
  71. self.say(event.channel, self.get_told_status(_z[1]))
  72. except IndexError:
  73. self.say(event.channel, "You didn\'t say who got told!")
  74. self.say(event.channel, self.get_told_status(event.user))