on_pubmsg.py 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import random, datetime
  2. def process_event(self, connection, event):
  3. if connection.get_nickname().lower() in event.arguments[0].lower() and event.source.nick is not connection.get_nickname(): # Bot's name was mentioned
  4. if event.arguments[0].startswith(self.cmdchar):
  5. return # Stop if it's a command.
  6. if not self.db.one("SELECT chat FROM channels WHERE name='" + event.target + "' AND network='" + self.network + "'"):
  7. return # Stop if channelfunction chat if off.
  8. messages = [
  9. "Hello " + event.source.nick + ".",
  10. "How are you today " + event.source.nick + "?",
  11. "Piss off " + event.source.nick + "!",
  12. event.source.nick + ", what are you botherring me for?",
  13. "Go bother someone else...",
  14. "Is life treating you fair?",
  15. "What's up?",
  16. "Why are you talking to me?",
  17. "I'm not talking to you!",
  18. "What have you been up to?",
  19. "How is life?",
  20. "What do you wan't from me?",
  21. event.source.nick + ", why are you bothering me?",
  22. event.source.nick + ", when will you stop talking about me?",
  23. event.source.nick + " I hate you!",
  24. "Get bent!",
  25. "Go and cut yourself.",
  26. "Do you think i care about you?",
  27. "Stop nickalerting me " + event.source.nick + ", you wanker!",
  28. ]
  29. actions = [
  30. "hides!",
  31. "dies.",
  32. "runs away.",
  33. "is ignoring that.",
  34. "is not feeling like caring.",
  35. "is away",
  36. "will be ignoring that.",
  37. "is faggaliciouz!! <333",
  38. "likes you! <3",
  39. "looks the other way...",
  40. "does a little dance with " + event.source.nick + ".",
  41. "makes a little love.",
  42. "get's down tonight.",
  43. "thinks SAM Broadcaster sucks raw cocks in hell!",
  44. "is secretly in love with " + event.source.nick + ".",
  45. "tosses " + event.source.nick + "'s salad.",
  46. "tortures " + event.source.nick + " horribly!",
  47. "is smelling like tuna when looking at " + event.source.nick + ".",
  48. "sniffing armpits.. Eew! Smells like " + event.source.nick + ".",
  49. "rapes " + event.source.nick + ".",
  50. ]
  51. # Reply with a random message or action.
  52. if random.randint(0, 1) == 0:
  53. connection.privmsg(event.target, random.choice(messages))
  54. else:
  55. connection.action(event.target, random.choice(actions))
  56. # Character lame.
  57. elif event.arguments[0] == len(event.arguments[0]) * event.arguments[0][0]: # Trigger exclusively same character.
  58. # Stop if chat channel function is off.
  59. if not self.db.one("SELECT chat FROM channels WHERE name='" + event.target + "' AND network='" + self.network + "'"):
  60. return
  61. # Stop if lamed recently.
  62. lastlame = self.db.one("SELECT last_lame FROM channels WHERE name='" + event.target + "' AND network='" + self.network + "'")
  63. if lastlame and lastlame > datetime.datetime.now() - datetime.timedelta(minutes=2): # In the last 2 minutes.
  64. return
  65. # Update lastlame.
  66. self.db.run("UPDATE channels SET last_lame='" + str(datetime.datetime.now()) + "' WHERE name='" + event.target + "' AND network='" + self.network + "'")
  67. connection.privmsg(event.target, event.arguments[0] + ".")