Strip irc colors correct, strip also ctrl chars (irc). Closes #286

This commit is contained in:
Wim 2017-10-26 23:04:44 +02:00
parent 76aafe1fa8
commit 299b71d982
1 changed files with 3 additions and 1 deletions

View File

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