diff --git a/chat.go b/chat.go index 0a83bcd..d62c9f0 100644 --- a/chat.go +++ b/chat.go @@ -132,7 +132,7 @@ func parseRumbleChatArgs(argsS string) []string { arg := []rune{} for _, c := range argsS { if c == ',' && open == 0 { - args = append(args, strings.TrimSpace(string(arg))) + args = append(args, trimRumbleChatArg(string(arg))) arg = []rune{} } else { if c == '[' { @@ -146,12 +146,16 @@ func parseRumbleChatArgs(argsS string) []string { } } if len(arg) > 0 { - args = append(args, strings.TrimSpace(string(arg))) + args = append(args, trimRumbleChatArg(string(arg))) } return args } +func trimRumbleChatArg(arg string) string { + return strings.Trim(strings.TrimSpace(arg), "\"") +} + type ChatMessage struct { Text string `json:"text"` }