diff --git a/onebot/xqcqcode.go b/onebot/xqcqcode.go index d2d864e..120e952 100644 --- a/onebot/xqcqcode.go +++ b/onebot/xqcqcode.go @@ -76,14 +76,14 @@ func whatCQprams(code string) map[string]interface{} { equal := strings.Index(code[start:], "=") + start if !strings.Contains(code[equal:], ",") { // 如果没有 , 参数 遍历完毕 - elems[code[index+1:equal]] = code[equal+1 : (len(code) - 1)] + elems[code[index+1:equal]] = escape(code[equal+1 : (len(code) - 1)]) break } end := strings.Index(code[equal:], ",") + equal - elems[code[index+1:equal]] = code[equal+1 : end] + elems[code[index+1:equal]] = escape(code[equal+1 : end]) start = end } - return map[string]interface{}{"data": escape(elems)} + return map[string]interface{}{"data": elems} } // xq2cqCode 普通XQ码转CQ码