I noticed that sometimes Discord messages would get silently lost and not transmitted to IRC for some reason. I traced the problem to the IRC message length limit - this would happen when the IRC PRIVMSG content was over 512 bytes.
To fix this I added a new field to the irc bot that would specify the chunk length in letters, and then in on_discord_message I used textwrap (from the Python standard library) to break the message into pieces and transmit that over to IRC - I used this method since it is Unicode aware and can avoid breaking words which is nice.
This seems to work very well and we are no longer losing messages. Let me know if you'd like any changes to the commit.
Hello,
I noticed that sometimes Discord messages would get silently lost and not transmitted to IRC for some reason. I traced the problem to the IRC message length limit - this would happen when the IRC PRIVMSG content was over 512 bytes.
To fix this I added a new field to the irc bot that would specify the chunk length in letters, and then in on_discord_message I used textwrap (from the Python standard library) to break the message into pieces and transmit that over to IRC - I used this method since it is Unicode aware and can avoid breaking words which is nice.
This seems to work very well and we are no longer losing messages. Let me know if you'd like any changes to the commit.