typing, reactions

This commit is contained in:
Cynthia Foxwell 2023-07-29 22:29:55 -06:00
parent 20778e93ca
commit 3f6a557e05
5 changed files with 65 additions and 1 deletions

View file

@ -301,7 +301,6 @@ func FormatMessage(options MessageOptions) []string {
}
} else {
content := options.Content
content = ReplaceMarkdown(content, options.NoColor)
if options.IsDM {
name := fmt.Sprintf("*%s*", options.Name)
@ -309,6 +308,8 @@ func FormatMessage(options MessageOptions) []string {
name = ansi.Color(name, "red+b")
}
content = ReplaceMarkdown(content, options.NoColor)
lines = append(lines, fmt.Sprintf("%s %s\x07\n\r", name, content))
} else if utf8.RuneCountInString(content) > 1 &&
(strings.HasPrefix(content, "*") && strings.HasSuffix(content, "*") && !strings.HasPrefix(content, "**") && !strings.HasSuffix(content, "**")) ||
@ -353,6 +354,8 @@ func FormatMessage(options MessageOptions) []string {
nameColor = "yellow+b"
}
content = ReplaceMarkdown(content, options.NoColor)
name := fmt.Sprintf("[%s]", options.Name)
if !options.NoColor {
name = ansi.Color(name, nameColor)