mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-12-29 04:41:22 +08:00
25 lines
692 B
TypeScript
25 lines
692 B
TypeScript
import BaseAction from '../BaseAction';
|
|
import { ActionName } from '../types';
|
|
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
|
|
|
const SchemaData = {
|
|
type: 'object',
|
|
properties: {
|
|
longNick: { type: 'string' },
|
|
},
|
|
required: ['longNick'],
|
|
} as const satisfies JSONSchema;
|
|
|
|
type Payload = FromSchema<typeof SchemaData>;
|
|
|
|
export class SetLongNick extends BaseAction<Payload, any> {
|
|
actionName = ActionName.SetLongNick;
|
|
PayloadSchema = SchemaData;
|
|
|
|
async _handle(payload: Payload) {
|
|
const NTQQUserApi = this.CoreContext.getApiContext().UserApi;
|
|
const ret = await NTQQUserApi.setLongNick(payload.longNick);
|
|
return ret;
|
|
}
|
|
}
|