mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-05 03:23:49 +08:00
配合 最新的MiraiGo调整代码
This commit is contained in:
parent
b2f46b4bbe
commit
05d8e773f2
@ -503,11 +503,19 @@ 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 := message.NewXmlMsg(template, i)
|
||||
msg := message.NewRichXml(template, i)
|
||||
return msg, nil
|
||||
case "json":
|
||||
resId := d["resid"]
|
||||
i, _ := strconv.ParseInt(resId, 10, 64)
|
||||
log.Warnf("json msg=%s", d["data"])
|
||||
msg := message.NewJsonMsg(CQCodeUnescapeValue(d["data"]))
|
||||
if i == 0 {
|
||||
//默认情况下走小程序通道
|
||||
msg := message.NewLightApp(CQCodeUnescapeValue(d["data"]))
|
||||
return msg, nil
|
||||
}
|
||||
//resid不为0的情况下走富文本通道,后续补全透传service Id,此处暂时不处理 TODO
|
||||
msg := message.NewRichJson(CQCodeUnescapeValue(d["data"]))
|
||||
return msg, nil
|
||||
default:
|
||||
return nil, errors.New("unsupported cq code: " + t)
|
||||
|
@ -179,6 +179,7 @@ Type: `json`
|
||||
| 参数名 | 类型 | 说明 |
|
||||
| ------ | ------ | ------------------------------------------------------------ |
|
||||
| data | string | json内容,json的所有字符串记得实体化处理|
|
||||
| resid | int32 | 默认不填为0,走小程序通道,填了走富文本通道发送|
|
||||
|
||||
json中的字符串需要进行转义:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user