NapCatQQ/packages/napcat-onebot/action/extends/SetGroupSign.ts
2025-11-13 15:10:47 +08:00

26 lines
788 B
TypeScript

import { GetPacketStatusDepends } from '@/napcat-onebot/action/packet/GetPacketStatus';
import { ActionName } from '@/napcat-onebot/action/router';
import { Static, Type } from '@sinclair/typebox';
const SchemaData = Type.Object({
group_id: Type.Union([Type.Number(), Type.String()]),
});
type Payload = Static<typeof SchemaData>;
class SetGroupSignBase extends GetPacketStatusDepends<Payload, void> {
override payloadSchema = SchemaData;
async _handle (payload: Payload) {
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;
}