mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
fix: 规范setSelfOnlineStatus接口参数命名
This commit is contained in:
parent
578f518aaf
commit
2f4dbaec4c
@ -7,10 +7,10 @@ const SchemaData = {
|
|||||||
type: 'object',
|
type: 'object',
|
||||||
properties: {
|
properties: {
|
||||||
status: { type: ['number', 'string'] },
|
status: { type: ['number', 'string'] },
|
||||||
extStatus: { type: ['number', 'string'] },
|
ext_status: { type: ['number', 'string'] },
|
||||||
batteryStatus: { type: ['number', 'string'] },
|
battery_status: { type: ['number', 'string'] },
|
||||||
},
|
},
|
||||||
required: ['status', 'extStatus', 'batteryStatus'],
|
required: ['status', 'ext_status', 'battery_status'],
|
||||||
} as const satisfies JSONSchema;
|
} as const satisfies JSONSchema;
|
||||||
|
|
||||||
type Payload = FromSchema<typeof SchemaData>;
|
type Payload = FromSchema<typeof SchemaData>;
|
||||||
@ -23,8 +23,8 @@ export class SetOnlineStatus extends BaseAction<Payload, null> {
|
|||||||
const NTQQUserApi = this.core.apis.UserApi;
|
const NTQQUserApi = this.core.apis.UserApi;
|
||||||
const ret = await NTQQUserApi.setSelfOnlineStatus(
|
const ret = await NTQQUserApi.setSelfOnlineStatus(
|
||||||
parseInt(payload.status.toString()),
|
parseInt(payload.status.toString()),
|
||||||
parseInt(payload.extStatus.toString()),
|
parseInt(payload.ext_status.toString()),
|
||||||
parseInt(payload.batteryStatus.toString()),
|
parseInt(payload.battery_status.toString()),
|
||||||
);
|
);
|
||||||
if (ret.result !== 0) {
|
if (ret.result !== 0) {
|
||||||
throw new Error('设置在线状态失败');
|
throw new Error('设置在线状态失败');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user