qaisjp / go-discord-irc

The Discord and IRC bridge with puppets! An IRC user is created for each Discord user, messages from IRC seamlessly appear on Discord, and Discord mentions are automagically converted to and from IRC.
MIT License
113 stars 32 forks source link

Replace all original message newlines with spaces in publishReaction #134

Closed yutotakano closed 2 years ago

yutotakano commented 2 years ago

This PR fixes the bug where Discord reactions to messages containing a newline within the first 40 characters triggers more than one message to be sent on IRC.

The fix is to replace all newline characters with spaces within publishReaction. We perform the replacement after the truncation so as to not do wasteful replacements.