mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-05 19:43:49 +08:00
cq:json 消息的初步支持
This commit is contained in:
parent
d25674a9ef
commit
710a8588b7
@ -502,10 +502,11 @@ func (bot *CQBot) ToElement(t string, d map[string]string, group bool) (message.
|
||||
template := CQCodeEscapeValue(d["data"])
|
||||
//println(template)
|
||||
i, _ := strconv.ParseInt(resId, 10, 64)
|
||||
msg := global.NewXmlMsg(template, i)
|
||||
msg := message.NewXmlMsg(template, i)
|
||||
return msg, nil
|
||||
case "json":
|
||||
msg := global.NewJsonMsg(d["data"])
|
||||
log.Warnf("json msg=%s", d["data"])
|
||||
msg := message.NewJsonMsg(CQCodeUnescapeValue(d["data"]))
|
||||
return msg, nil
|
||||
default:
|
||||
return nil, errors.New("unsupported cq code: " + t)
|
||||
|
Loading…
x
Reference in New Issue
Block a user