jimmies.py 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #Jimmies module created by Bonekin#
  2. from __future__ import print_function
  3. from event import Event
  4. import random
  5. import sys
  6. try:
  7. if sys.version_info > (3, 0, 0):
  8. from .basemodule import BaseModule
  9. else:
  10. from basemodule import BaseModule
  11. except (ImportError, SystemError):
  12. from modules.basemodule import BaseModule
  13. class Jimmies(BaseModule):
  14. def post_init(self):
  15. jimmies = Event("__.jimmies__")
  16. jimmies.define(msg_definition="^\.jimmies")
  17. jimmies.subscribe(self)
  18. self.cmd = ".jimmies"
  19. self.help = ".jimmies <nick>"
  20. self.bot.register_event(jimmies, self) # Register ourself to our new custom event
  21. def get_jimmies_status(self):
  22. """Randomly selects and returns a string with a "jimmies" status."""
  23. status = [" Rustled [ ] Not Rustled",
  24. "Rustled as fuck",
  25. "Rustled as fuark",
  26. "Rustled 'n' hustled",
  27. "Professor James R. Russel, Department of Primatology",
  28. "le monkey face",
  29. "No rustling. Only dreams now.",
  30. "Y'all rusting in a jimmies thread",
  31. "Haha. Oh god. Mah jimmies.",
  32. "The jimmies have been compromised.",
  33. "A gorillion jimmies.",
  34. "Boku no rustled",
  35. "Rustle of the Planet of the Jimmies",
  36. "You just rustled my jimmy card",
  37. "Micky Rourke as The Rustler",
  38. ">he thinks his jimmies are unrustled",
  39. "WWE Rustlemania",
  40. "Teach Me How To Jimmie",
  41. "#3 Rustle Wilson",
  42. "Rustle-it Ralph",
  43. "All those people. All that rustling.",
  44. "Rustle Brand",
  45. "Everyone's getting rustled!",
  46. "Did someone rustle your jimmies? Show me on the doll where they rustled you.",
  47. "Oh shit! My jimmies!"
  48. ]
  49. return "[X] " + random.choice(status)
  50. def handle(self, event):
  51. _z = event.msg.split(None, 1)
  52. jimmies_status = self.get_jimmies_status() # Gets the jimmies status from the list above
  53. try:
  54. self.say(event.channel, "Jimmies status for " + _z[1]+ ": " + jimmies_status) # Prints the jimmies status to the proper channel if a user is specified properly
  55. except IndexError:
  56. self.say(event.channel, "You didn\'t specify whose jimmies you wanted to check. " + event.user + "\'s jimmies status: " + jimmies_status) # Spits into channel if user not specified correctly
  57. except TypeError:
  58. print("DEBUG: TypeError: ", end=' ')
  59. print(event.channel, end=' ')
  60. print(event.user)