Skip to content

Commit

Permalink
fix: 缺失的module/api (#11)
Browse files Browse the repository at this point in the history
* fix: 缺失的module/api

* fix: fxxk copilot

* fix: 参数类型

* fix: int64 -> int32
  • Loading branch information
RF-Tar-Railt authored Nov 7, 2024
1 parent 87e1d19 commit 555886d
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 17 deletions.
26 changes: 14 additions & 12 deletions coolq/cqcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ func toElements(e []message.IMessageElement, source message.Source) (r []msg.Ele
},
}
// TODO LightAppElement
//case *message.LightAppElement:
// m = msg.Element{
// Type: "json",
// Data: pairs{
// {K: "data", V: o.Content},
// },
// }
case *message.LightAppElement:
m = msg.Element{
Type: "json",
Data: pairs{
{K: "data", V: o.Content},
},
}
case *message.AtElement:
target := "all"
if o.TargetUin != 0 {
Expand Down Expand Up @@ -296,11 +296,11 @@ func ToMessageContent(e []message.IMessageElement, source message.Source) (r []g
"type": "text",
"data": global.MSG{"text": o.Content},
}
//case *message.LightAppElement:
// m = global.MSG{
// "type": "json",
// "data": global.MSG{"data": o.Content},
// }
case *message.LightAppElement:
m = global.MSG{
"type": "json",
"data": global.MSG{"data": o.Content},
}
case *message.AtElement:
if o.TargetUin == 0 {
m = global.MSG{
Expand Down Expand Up @@ -802,6 +802,8 @@ func (bot *CQBot) ConvertElement(spec *onebot.Spec, elem msg.Element, sourceType
// }
// // resid不为0的情况下走富文本通道,后续补全透传service Id,此处暂时不处理 TODO
// return message.NewRichJson(data), nil
case "json":
return message.NewLightApp(elem.Get("data")), nil
//case "cardimage":
// source := elem.Get("source")
// icon := elem.Get("icon")
Expand Down
77 changes: 72 additions & 5 deletions modules/api/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 555886d

Please sign in to comment.