Skip to content

Commit

Permalink
BotBackup: catch the messages on the way in.
Browse files Browse the repository at this point in the history
This way we don't even have to execute commands if precedents are present.
Also, not just for privmsg anymore, so any on-join actions etc are also managed.
  • Loading branch information
Daniel Folkinshteyn committed May 23, 2013
1 parent 0e1a588 commit 359b79f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions BotBackup/plugin.py
Expand Up @@ -39,12 +39,10 @@ class BotBackup(callbacks.Plugin):
"""This plugin lets you run a live instance of a backup bot. It will keep
the backup bot silent unless all the precedent bots are offline."""
threaded=True
def outFilter(self, irc, msg):

def inFilter(self, irc, msg):
quiet = False
if msg.command == 'PRIVMSG' and \
irc.isChannel(msg.args[0]) and \
msg.inReplyTo is not None: # 'say' msgs don't have an inReplyTo
if irc.isChannel(msg.args[0]):
for pn in self.registryValue('precedentBotNicks'):
if pn in irc.state.channels[msg.args[0]].users:
quiet = True
Expand Down

0 comments on commit 359b79f

Please sign in to comment.