From: CMDR furrycat Date: Thu, 2 Mar 2017 10:08:15 +0000 (+0000) Subject: Account for newlines in say_many(). X-Git-Url: http://git.furryclan.net/?a=commitdiff_plain;h=0d12abe50e2e03d90fad839380da200a30bbf1c6;p=furrycat%2Fcatbot.git Account for newlines in say_many(). --- diff --git a/bot.py b/bot.py index 70398f8..1db2eb9 100644 --- a/bot.py +++ b/bot.py @@ -425,6 +425,9 @@ def say_many(channel, lines, *, attachment = None, embed = None, maxlen = 2000): n = 0 for i in range(0, len(lines)): message_len += len(lines[i]) + if i: + # Include newlines. + message_len += 1 if message_len > maxlen: break n += 1