I’m writing an IRC bot and I’m trying to figure out the maximum length that a message can have in characters, so that I know when to split long messages into several parts.
I found out that Twitch limits the length of messages to 500 characters, which does not include the characters for the rest of an IRC message at the protocol level. This can result in Twitch sending me IRC messages (the ones at the protocol level) that are much longer than the 512-character limit specified in RFC 1459.
However, I also found out that the Twitch server is dropping IRC messages that are longer than 469 characters. Those 469 characters include the IRC protocol header consisting of the PRIVMSG command, the parameters, the actual text message and the terminating CR/LF pair.
I’m wondering whether there’s a mistake on my part. A limit of 469 characters for server-inbound IRC messages seems kind of random.