Ignore message content from color and region tags

This commit is contained in:
rigormorrtiss 2021-08-07 23:11:42 +04:00
parent 8539dc1416
commit a544c05bfe

View file

@ -17,9 +17,7 @@ func WriteMessage(v *tview.TextView, s *state.State, m discord.Message) {
// $ AUTHOR_USERNAME (BOT)*space*
writeAuthor(&b, s, m.Author)
// $ MESSAGE_CONTENT
if m.Content != "" {
b.WriteString(m.Content)
}
writeContent(&b, m.Content)
// $ *space*(edited)
if m.EditedTimestamp.IsValid() {
@ -71,7 +69,14 @@ func writeReferencedMessage(b *strings.Builder, rm *discord.Message) {
// Reset foreground
b.WriteString("[-::] ")
b.WriteString(rm.Content)
writeContent(b, rm.Content)
b.WriteString("[-:-:-]\n")
}
}
func writeContent(b *strings.Builder, c string) {
if c != "" {
c = tview.Escape(c)
b.WriteString(c)
}
}