common.py 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. import random
  2. from datetime import datetime
  3. from common import queries, userstatus, log
  4. class Inform():
  5. def owners(self, connection, message):
  6. log.info('Informing owners: %s' % message)
  7. if self.network.home_channel in self.channels:
  8. for owner in self.channels[self.network.home_channel].owners():
  9. connection.privmsg(owner, message)
  10. def notice_owners(self, connection, message):
  11. log.info('Notifying owners: %s' % message)
  12. if self.network.home_channel in self.channels:
  13. for owner in self.channels[self.network.home_channel].owners():
  14. connection.notice(owner, message)
  15. def operators(self, connection, message):
  16. log.info('Informing operators: %s' % message)
  17. if self.homechannel in self.channels:
  18. for user in self.channels[self.homechannel].owners():
  19. connection.privmsg(user, message)
  20. for user in self.channels[self.homechannel].admins():
  21. connection.privmsg(user, message)
  22. for user in self.channels[self.homechannel].opers():
  23. connection.privmsg(user, message)
  24. def home_channel(self, connection, message):
  25. log.info('Informing home channel: %s' % message)
  26. connection.privmsg(self.network.home_channel, message)
  27. # class Protectees():
  28. # def update(self, nick, user, host):
  29. # if nick in self.protectees: # On record.
  30. # if userstatus.atleast_halfop(self, user, self.homechannel) or nick == self.connection.get_nickname(): # Update. Is atleast halfop or bot itself.
  31. # self.protectees[nick].update({'ident': nick + "!" + user + "@" + host})
  32. # else: # Delete.
  33. # del self.protectees[nick]
  34. # else: # Append.
  35. # if userstatus.atleast_halfop(self, user, self.homechannel) or nick == self.connection.get_nickname(): # Update. Is atleast halfop or bot itself.
  36. # self.protectees[nick] = {'ident': nick + "!" + user + "@" + host}
  37. # class Replyto():
  38. # def name(connection, event):
  39. # messages = [
  40. # "Hello " + event.source.nick + ".",
  41. # "How are you today " + event.source.nick + "?",
  42. # "Piss off " + event.source.nick + "!",
  43. # event.source.nick + ", what are you botherring me for?",
  44. # "Go bother someone else...",
  45. # "Is life treating you fair?",
  46. # "What's up?",
  47. # "Why are you talking to me?",
  48. # "I'm not talking to you!",
  49. # "What have you been up to?",
  50. # "How is life?",
  51. # "What do you want from me?",
  52. # event.source.nick + ", why are you bothering me?",
  53. # event.source.nick + ", when will you stop talking about me?",
  54. # event.source.nick + " I hate you!",
  55. # "Get bent!",
  56. # "Go and cut yourself.",
  57. # "Do you think i care about you?",
  58. # "Stop nickalerting me " + event.source.nick + ", you wanker!",
  59. # ]
  60. # actions = [
  61. # "hides!",
  62. # "dies.",
  63. # "runs away.",
  64. # "is ignoring that.",
  65. # "is not feeling like caring.",
  66. # "is away",
  67. # "will be ignoring that.",
  68. # "is faggaliciouz!! <333",
  69. # "likes you! <3",
  70. # "looks the other way...",
  71. # "does a little dance with " + event.source.nick + ".",
  72. # "makes a little love.",
  73. # "get's down tonight.",
  74. # "thinks SAM Broadcaster sucks raw cocks in hell!",
  75. # "is secretly in love with " + event.source.nick + ".",
  76. # "tosses " + event.source.nick + "'s salad.",
  77. # "tortures " + event.source.nick + " horribly!",
  78. # "is smelling like tuna when looking at " + event.source.nick + ".",
  79. # "sniffing armpits.. Eew! Smells like " + event.source.nick + ".",
  80. # "rapes " + event.source.nick + ".",
  81. # "pets " + event.source.nick + ", and sais: Why what a nice little human you are, and such plentifull organs!"
  82. # ]
  83. #
  84. # # Reply with a random message or action.
  85. # if random.randint(0, 1) == 0:
  86. # connection.privmsg(event.target, random.choice(messages))
  87. # else:
  88. # connection.action(event.target, random.choice(actions))
  89. # class Aggressiveness():
  90. # def retalliation_reason(self, connection, protectee, behaviour):
  91. # if protectee == connection.get_nickname(): # Bot itself.
  92. # return "Aggression channel function = " + behaviour + ": Self defense."
  93. # else:
  94. # return "Aggression channel function = " + behaviour + ": " + protectee + " is atlast halfop in " + self.homechannel + "."
  95. #