From efe7f1cf1b4b2cbb343132a17bbec9807a7939f4 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Fri, 25 Apr 2014 11:33:09 -0700 Subject: [PATCH] Send broadcast messages with notice command If the bot has +v or +o, it bypasses target change rate limits. Also, it stands out more in most clients. Change-Id: I1dc7dcb4cbfc8ab6ce70d1e34720a2753cf36a96 --- statusbot/bot.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/statusbot/bot.py b/statusbot/bot.py index 8505060..039b808 100644 --- a/statusbot/bot.py +++ b/statusbot/bot.py @@ -303,7 +303,7 @@ class StatusBot(irc.bot.SingleServerIRCBot): t = self.topics.get(channel, channel) self.set_topic(channel, t) if msg: - self.send(channel, prefix + msg) + self.notice(channel, prefix + msg) if set_topic: self.set_topic(channel, msg) @@ -321,6 +321,10 @@ class StatusBot(irc.bot.SingleServerIRCBot): self.log.info("Current topic on %s is %s" % (channel, topic)) self.topics[channel] = topic + def notice(self, channel, msg): + self.connection.notice(channel, msg) + time.sleep(ANTI_FLOOD_SLEEP) + def send(self, channel, msg): self.connection.privmsg(channel, msg) time.sleep(ANTI_FLOOD_SLEEP)