]> git.0d.be Git - botaradio.git/commitdiff
fix: multi-line message, fixed #103
authorTerry Geng <gengyanda@gmail.com>
Mon, 16 Mar 2020 01:27:37 +0000 (09:27 +0800)
committerTerry Geng <gengyanda@gmail.com>
Mon, 16 Mar 2020 01:27:37 +0000 (09:27 +0800)
command.py

index 7e42533164eef9693f2d636db1f614519b52815d..28c38d85c45e1ce5148dc3f693e2d6758ea5b4cf 100644 (file)
@@ -77,7 +77,8 @@ def send_multi_lines(bot, lines, text, linebreak="<br />"):
     for newline in lines:
         msg += br
         br = linebreak
-        if (len(msg) + len(newline)) > (bot.mumble.get_max_message_length() - 4) != 0:  # 4 == len("<br>")
+        if bot.mumble.get_max_message_length()\
+                    and (len(msg) + len(newline)) > (bot.mumble.get_max_message_length() - 4):  # 4 == len("<br>")
             bot.send_msg(msg, text)
             msg = ""
         msg += newline