Don't send keyword notifications if the message source is the reporting channel

pull/1/head
Mark Veidemanis 7 years ago
parent 742d9c0c91
commit 2ef3782c6d

@ -67,21 +67,6 @@ class IRCBot(IRCClient):
else:
self.password = instance["password"]
def privmsg(self, user, channel, msg):
toSend = helper.isKeyword(msg)
if toSend:
helper.sendMaster("MATCH PRV %s (U:%s T:%s): (%s/%s) %s" % (self.name, toSend[1], toSend[2], user, channel, toSend[0]))
def noticed(self, user, channel, msg):
toSend = helper.isKeyword(msg)
if toSend:
helper.sendMaster("MATCH NOT %s (U:%s T:%s): (%s/%s) %s" % (self.name, toSend[1], toSend[2], user, channel, toSend[0]))
def action(self, user, channel, msg):
toSend = helper.isKeyword(msg)
if toSend:
helper.sendMaster("MATCH ACT %s (U:%s T:%s): (%s/%s) %s" % (self.name, toSend[1], toSend[2], user, channel, toSend[0]))
def refresh(self):
instance = pool[self.name]
if not instance["nickname"] == self.nickname:
@ -95,6 +80,30 @@ class IRCBot(IRCClient):
self.versionEnv = None
self.sourceURL = instance["source"]
def privmsg(self, user, channel, msg):
toSend = helper.isKeyword(msg)
if toSend:
if self.name == config["Master"][0] and channel == config["Master"][1]:
pass
else:
helper.sendMaster("MATCH PRV %s (U:%s T:%s): (%s/%s) %s" % (self.name, toSend[1], toSend[2], user, channel, toSend[0]))
def noticed(self, user, channel, msg):
toSend = helper.isKeyword(msg)
if toSend:
if self.name == config["Master"][0] and channel == config["Master"][1]:
pass
else:
helper.sendMaster("MATCH NOT %s (U:%s T:%s): (%s/%s) %s" % (self.name, toSend[1], toSend[2], user, channel, toSend[0]))
def action(self, user, channel, msg):
toSend = helper.isKeyword(msg)
if toSend:
if self.name == config["Master"][0] and channel == config["Master"][1]:
pass
else:
helper.sendMaster("MATCH ACT %s (U:%s T:%s): (%s/%s) %s" % (self.name, toSend[1], toSend[2], user, channel, toSend[0]))
def get(self, var):
try:
result = getattr(self, var)

Loading…
Cancel
Save