feat(onebot): report forced offline as notice/bot_offline

Register a handler for the StatusService.KickNT push (QQ NT's unified
forced-offline notification — kick / login-elsewhere / risk-control),
decode KickNTResponse and emit bot_offline {user_id, tag, message},
matching NapCat. Command + field layout (f4=tips_title, f3=tips_content)
RE-confirmed against wrapper.linux.node + Lagrange; not yet live-captured.
This commit is contained in:
DrSmoothl committed 2026-07-07 15:25:35 +08:00
1 parent eda1c32994
commit d9dfe513ee
9 files changed
+120 -1

No files matched your search

+13 -1
View File
@@ -294,6 +294,17 @@ export interface PttTransResultEvent extends QQEvent {
text: string;
}
/**
* The bot account was forced offline (kicked / logged in elsewhere / risk-control)
* — SSO push `StatusService.KickNT`. Mirrors NapCat's OB11BotOfflineEvent →
* `notice_type:'bot_offline'`. `tag` = short title, `message` = description.
*/
export interface BotOfflineEvent extends QQEvent {
kind: 'bot_offline';
tag: string;
message: string;
}
/**
* A group member's card (群名片) changed — detected from message traffic when
* the sender's live card differs from the cached one (same mechanism as NapCat's
@@ -377,4 +388,5 @@ export type QQEventVariant =
| GroupNameChangeEvent
| GroupCardChangeEvent
| GroupTitleChangeEvent
| FriendProfileLikeEvent;
| FriendProfileLikeEvent
| BotOfflineEvent;