Make the irc gateway compatible with multi-line messages

This commit is contained in:
goeo_ 2017-08-20 17:10:15 +03:00
parent 018da5c0a2
commit b8baddf694

View File

@ -254,7 +254,9 @@ def sendMessage(fro = "", to = "", message = "", token = None, toIRC = True):
# Send the message to IRC # Send the message to IRC
if glob.irc == True and toIRC == True: if glob.irc == True and toIRC == True:
glob.ircServer.banchoMessage(fro, to, message.encode("latin-1").decode("utf-8")) messageSplitInLines = message.encode("latin-1").decode("utf-8").split("\n")
for line in messageSplitInLines:
glob.ircServer.banchoMessage(fro, to, line)
# Spam protection (ignore FokaBot) # Spam protection (ignore FokaBot)
if token.userID > 999: if token.userID > 999: