fix: update BotStatus type in oneBotRawEvent and adjust status checks

This commit is contained in:
Hoshina
2026-02-14 19:58:19 +08:00
parent f7421128a0
commit 773ce9bcb6

View File

@@ -45,7 +45,12 @@ type oneBotRawEvent struct {
MetaEventType string `json:"meta_event_type"` MetaEventType string `json:"meta_event_type"`
Echo string `json:"echo"` Echo string `json:"echo"`
RetCode json.RawMessage `json:"retcode"` RetCode json.RawMessage `json:"retcode"`
Status string `json:"status"` Status BotStatus `json:"status"`
}
type BotStatus struct {
Online bool `json:"online"`
Good bool `json:"good"`
} }
type oneBotSender struct { type oneBotSender struct {
@@ -322,7 +327,7 @@ func (c *OneBotChannel) listen() {
continue continue
} }
if raw.Echo != "" || raw.Status != "" { if raw.Echo != "" || raw.Status.Online || raw.Status.Good {
logger.DebugCF("onebot", "Received API response, skipping", map[string]interface{}{ logger.DebugCF("onebot", "Received API response, skipping", map[string]interface{}{
"echo": raw.Echo, "echo": raw.Echo,
"status": raw.Status, "status": raw.Status,