NapCatQQ/packages/napcat-onebot/action/extends/SetGroupSign.ts
手瓜一十雪 46ff1a64e9 Add action tags to OneBot API schema and update tag name
Included the 'tags' property in the OneBot API schema for both backend and frontend, allowing actions to be categorized. Also updated the action tag from '群扩展' to '群组扩展' in SetGroupSign for consistency.
2026-01-25 21:06:21 +08:00

37 lines
1.1 KiB
TypeScript

import { GetPacketStatusDepends } from '@/napcat-onebot/action/packet/GetPacketStatus';
import { ActionName } from '@/napcat-onebot/action/router';
import { Static, Type } from '@sinclair/typebox';
const PayloadSchema = Type.Object({
group_id: Type.String({ description: '群号' }),
});
type PayloadType = Static<typeof PayloadSchema>;
const ReturnSchema = Type.Void({ description: '打卡结果' });
type ReturnType = Static<typeof ReturnSchema>;
class SetGroupSignBase extends GetPacketStatusDepends<PayloadType, ReturnType> {
override payloadSchema = PayloadSchema;
override returnSchema = ReturnSchema;
override actionSummary = '设置群签名';
override actionTags = ['群组扩展'];
override payloadExample = {
group_id: '123456789'
};
override returnExample = null;
async _handle (payload: PayloadType) {
return await this.core.apis.PacketApi.pkt.operation.GroupSign(+payload.group_id);
}
}
export class SetGroupSign extends SetGroupSignBase {
override actionName = ActionName.SetGroupSign;
}
export class SendGroupSign extends SetGroupSignBase {
override actionName = ActionName.SendGroupSign;
}