diff --git a/nardco.py b/nardco.py index c254ec787860ecbeb41040b6decc479b5ce8ee52..797ab3a7e007da3d98723aa4f665e823eeb3d080 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")