5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-12-25 04:55:41 +00:00

Try again to strip colors correct. #286

This commit is contained in:
Wim 2017-10-28 14:28:15 +02:00
parent 41aa8ad799
commit b7a8c6b60f

View File

@ -288,9 +288,7 @@ func (b *Birc) handlePrivMsg(event *irc.Event) {
}
msg += event.Message()
// strip IRC colors
re := regexp.MustCompile(`\x03(\d+,|)\d+`)
msg = re.ReplaceAllString(msg, "")
re = regexp.MustCompile(`[[:cntrl:]]`)
re := regexp.MustCompile(`[[:cntrl:]](?:\d{1,2}(?:,\d{1,2})?)?`)
msg = re.ReplaceAllString(msg, "")
var r io.Reader