New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cut long messages in multiple lines #92
Comments
To clarify on this issue, IRC messages have a maximum size of 512 bytes, including the two line ending bytes
Although this message is under 510 bytes - 494 bytes to be precise - the actual message sent could be as follows:
The length of this full message is 520 bytes, so the intended message will be cut off. To make matters worse, we could send the following message:
This length of this full message is only 475 bytes. However, the message that the server broadcasts to other clients could be as follows:
The length of this message from the server is 536 bytes, which will be cut off. As such, the bot could retrieve information from the server about max nick length, max username length, max hostname length, and max channel name length, in order to calculate how many bytes are safe to send. Alternatively, the bot could calculate this byte count based on its own nick/username/hostname and the destination to which it is sending the message. This may be a better solution as it will allow as many bytes to be sent as can fit in the IRC message. |
For example when terminus is used in IRCNet, help messages and other longer private messages get cut up by, max line length seems to be around 465 characters + bot nick
terminus should send multiple private messages when line length exceeds 400 characters.
The text was updated successfully, but these errors were encountered: