diff --git a/bridge/slack/slack.go b/bridge/slack/slack.go index 36b74b99..2fcf807f 100644 --- a/bridge/slack/slack.go +++ b/bridge/slack/slack.go @@ -7,6 +7,7 @@ import ( "strings" "sync" "time" + "regexp" "github.com/42wim/matterbridge/bridge" "github.com/42wim/matterbridge/bridge/config" @@ -181,6 +182,10 @@ func (b *Bslack) Send(msg config.Message) (string, error) { msg.Text = b.replaceCodeFence(msg.Text) + // Strip IRC colors sent to Slack + 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 + "_"