mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-04 22:51:13 +00:00
Replaced imports of ActionExamples with ExtendsActionsExamples in all extends actions. Updated action summary, description, tags, and example references for consistency and clarity across actions. This improves maintainability and aligns with the new examples structure.
31 lines
1.1 KiB
TypeScript
31 lines
1.1 KiB
TypeScript
import { OneBotAction } from '@/napcat-onebot/action/OneBotAction';
|
|
import { ActionName } from '@/napcat-onebot/action/router';
|
|
import { Static, Type } from '@sinclair/typebox';
|
|
|
|
import { ExtendsActionsExamples } from './examples';
|
|
|
|
const PayloadSchema = Type.Object({
|
|
longNick: Type.String({ description: '签名内容' }),
|
|
});
|
|
|
|
type PayloadType = Static<typeof PayloadSchema>;
|
|
|
|
const ReturnSchema = Type.Any({ description: '设置结果' });
|
|
|
|
type ReturnType = Static<typeof ReturnSchema>;
|
|
|
|
export class SetLongNick extends OneBotAction<PayloadType, ReturnType> {
|
|
override actionName = ActionName.SetLongNick;
|
|
override payloadSchema = PayloadSchema;
|
|
override returnSchema = ReturnSchema;
|
|
override actionSummary = '设置个性签名';
|
|
override actionDescription = '修改当前登录帐号的个性签名';
|
|
override actionTags = ['扩展接口'];
|
|
override payloadExample = ExtendsActionsExamples.SetLongNick.payload;
|
|
override returnExample = ExtendsActionsExamples.SetLongNick.response;
|
|
|
|
async _handle (payload: PayloadType) {
|
|
return await this.core.apis.UserApi.setLongNick(payload.longNick);
|
|
}
|
|
}
|