mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-04 14:41:14 +00:00
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.
37 lines
1.1 KiB
TypeScript
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;
|
|
}
|