Trimmed quotes from RumbleChat args

This commit is contained in:
tyler 2024-05-16 17:03:28 -04:00
parent 5b3593ec1e
commit a779afcaba

View file

@ -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"`
}