From a779afcaba8ed4d6b92e95a21ab428c69a10abb7 Mon Sep 17 00:00:00 2001 From: tyler Date: Thu, 16 May 2024 17:03:28 -0400 Subject: [PATCH] Trimmed quotes from RumbleChat args --- chat.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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"` }