I have recently been developing a bot that needs to be able to post using whitespace. It seems that Twitch is stripping whitespace from bot posts. In chat, for example, if I use the EN QUAD, U+2000, the space is not stripped, but if I send the same message via an IRC bot the whitespace is stripped. Is this expected behavior or is it just a bug? See below for the python code.
...
eq = u" "*4 # EN QUAD Whitespace
mesg = u" x " # Message with normal spaces
mesg = mesg.replace(" ", eq)
print mesg
self.socket.send(u"PRIVMSG {} :{}\r\n".format(TWITCH_CHAN, msg).encode("utf-8"))
time.sleep(10)
...
I can assure you that in my code it is an eq… Twitch seems to be stripping all whitespace to one space, regardless. I also did try to use the explicit syntax as well.
White-space characters are trimmed on purpose to avoid walls of spam in chat and accidental spaces before a command. Extensions or separate webpages would be better used for formatted output.