diff --git a/ircbot/bot.py b/ircbot/bot.py index 2f43767..df7b617 100644 --- a/ircbot/bot.py +++ b/ircbot/bot.py @@ -872,6 +872,7 @@ class IRCBot(irc.client.SimpleIRCClient): if recursing: return replystr else: + lines = 0 replies = replystr.split('\n') for reply in replies: # split messages that are too long. max length is 512, but we also need to @@ -886,6 +887,10 @@ class IRCBot(irc.client.SimpleIRCClient): reply = self.splitter + ' ' + reply[splitpos + 1:] self.privmsg(replypath, splittext) + # antiflood + lines += 1 + time.sleep(int(0.5 * lines)) + # done splitting, or it was never necessary self.privmsg(replypath, reply) if stop: