feat(onebot): add set_diy_online_status
DIY online status reuses the existing StatusService.SetStatus wire call. napcat hardcodes status=10 / extStatus=2000 and threads the faceId / wording / faceType through a customExt sub-message (field 4 of SetStatus, per napcat packet/transformer/proto/action/action.ts). Implementation: - Extend SetStatusReqSchema with optional customExt field. Encoder skips undefined fields so the existing set_online_status path stays byte-identical on the wire (verified by a new round-trip test). - New bridge.setDiyOnlineStatus(faceId, wording, faceType) wraps the same dispatchSetStatus helper as setOnlineStatus. - OneBot action set_diy_online_status accepts napcat-style payloads (face_id / face_type can be string or number; wording defaults to ''). 9 new tests across actions/profile and onebot/extended-actions.
This commit is contained in:
7 files changed
+160
-5
No files matched your search
@@ -85,6 +85,7 @@ import {
|
||||
} from './actions/friend';
|
||||
import {
|
||||
setOnlineStatus as setOnlineStatus_,
|
||||
setDiyOnlineStatus as setDiyOnlineStatus_,
|
||||
setProfile as setProfile_,
|
||||
setSelfLongNick as setSelfLongNick_,
|
||||
setInputStatus as setInputStatus_,
|
||||
@@ -503,6 +504,9 @@ export class Bridge implements BridgeInterface {
|
||||
async setOnlineStatus(status: number, extStatus: number = 0, batteryStatus: number = 100): Promise<void> {
|
||||
return setOnlineStatus_(this, status, extStatus, batteryStatus);
|
||||
}
|
||||
async setDiyOnlineStatus(faceId: number, wording: string, faceType: number): Promise<void> {
|
||||
return setDiyOnlineStatus_(this, faceId, wording, faceType);
|
||||
}
|
||||
async setProfile(nickname?: string, personalNote?: string): Promise<void> {
|
||||
return setProfile_(this, nickname, personalNote);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user