From e3945bbb3da4eae2c52f08639f31ccc14870acb4 Mon Sep 17 00:00:00 2001
From: Loris TICHADOU <loris.tichadou@ensiie.fr>
Date: Tue, 10 Mar 2020 17:20:33 +0100
Subject: [PATCH] Update nardco.py

---
 nardco.py | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/nardco.py b/nardco.py
index c254ec7..797ab3a 100755
--- a/nardco.py
+++ b/nardco.py
@@ -79,6 +79,9 @@ def no_hl(pseudo):
     ins = u'\u200C'.encode("utf-8")
     return pseudo[0] + str(ins) + pseudo[1:]
 
+def split_message(message) : 
+    return [line[i:i+150] for i in range(0, len(line), 150)]
+
 
 class Boooob(ircbot.SingleServerIRCBot):
     def __init__(self):
@@ -361,11 +364,17 @@ class Boooob(ircbot.SingleServerIRCBot):
                 live_ = []
                 dead_ = []
                 for f in live:
-                    live_.append(no_hl(f))
+                    live_.append(f)
                 for f in dead:
-                    dead_.append(no_hl(f))
-                serv.privmsg(canal, "Vivants : {0}".format(", ".join(live_)))
-                serv.privmsg(canal, "Morts : {0}".format(", ".join(dead_)))
+                    dead_.append(f)
+                vivants = "Vivants : {0}".format(", ".join(live_))
+                morts = "Morts : {0}".format(", ".join(dead_))
+                for msg in split_message(vivants) :
+                    serv.privmsg(canal, msg)
+                    time.sleep(0.2)
+                for msg in split_message(morts) :
+                    serv.privmsg(canal, msg)
+                    time.sleep(0.2)
                 #serv.mode(canal, "+" + len(live)*'v' + " "+" ".join(live))
                 #serv.mode(canal, "+m")
 
-- 
GitLab