From 34429fa5499138c2bf9c63594726baa0a324748f Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Fri, 7 Mar 2014 08:02:00 -0800 Subject: [PATCH] Sleep when joining channels Otherwise there is flooding. Also, log topic changes at INFO level. Change-Id: I4f105a9e2cc9ecdfbe67565f32ca6c1389fae282 --- statusbot/bot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/statusbot/bot.py b/statusbot/bot.py index c328499..8eb5ff6 100644 --- a/statusbot/bot.py +++ b/statusbot/bot.py @@ -219,6 +219,7 @@ class StatusBot(irc.bot.SingleServerIRCBot): for channel in self.channel_list: self.log.info("Joining %s" % channel) c.join(channel) + time.sleep(0.5) def on_cap(self, c, e): self.log.debug("Received cap response %s" % repr(e.arguments)) @@ -331,6 +332,8 @@ class StatusBot(irc.bot.SingleServerIRCBot): def on_currenttopic(self, c, e): if self.ignore_topics: return + self.log.info("Current topic on %s is %s" % (e.arguments[0], + e.arguments[1])) self.topics[e.arguments[0]] = e.arguments[1] def send(self, channel, msg): @@ -338,7 +341,7 @@ class StatusBot(irc.bot.SingleServerIRCBot): time.sleep(0.5) def set_topic(self, channel, topic): - self.connection.topic(channel, topic) + self.log.info("Setting topic on %s to %s" % (channel, topic)) self.connection.privmsg('ChanServ', 'topic %s %s' % (channel, topic)) time.sleep(0.5)