diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go index 49dfe4bc..1e21af99 100644 --- a/bridge/discord/discord.go +++ b/bridge/discord/discord.go @@ -187,6 +187,10 @@ func (b *Bdiscord) Send(msg config.Message) (string, error) { return "", fmt.Errorf("Could not find channelID for %v", msg.Channel) } + // Strip IRC colors sent to Discord + re := regexp.MustCompile(`\x03(?:\d{1,2}(?:,\d{1,2})?)?|[[:cntrl:]]`) + msg.Text = re.ReplaceAllString(msg.Text, "") + // Make a action /me of the message if msg.Event == config.EventUserAction { msg.Text = "_" + msg.Text + "_"