1
0
mirror of https://github.com/fumiama/go-onebot-agent.git synced 2026-06-08 20:10:31 +08:00

feat: add more apis & handle resp

This commit is contained in:
源文雨
2025-09-25 23:02:09 +08:00
parent 0cdc929590
commit 46ace7c2b1
7 changed files with 257 additions and 23 deletions

View File

@@ -38,3 +38,20 @@ func (ev *Event) String() string {
}
return strings.TrimSpace(sb.String())
}
type APIResponse struct {
Status string `json:"status"`
Data json.RawMessage `json:"data"`
Message string `json:"message"`
Wording string `json:"wording"`
RetCode int64 `json:"retcode"`
}
func (resp *APIResponse) String() string {
sb := strings.Builder{}
err := json.NewEncoder(&sb).Encode(resp)
if err != nil {
panic(errors.Wrap(err, "unexpected"))
}
return strings.TrimSpace(sb.String())
}