mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-12-31 23:09:09 +08:00
27 lines
819 B
TypeScript
27 lines
819 B
TypeScript
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
|
import { ActionName } from '@/onebot/action/router';
|
|
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
|
|
|
|
|
const SchemaData = {
|
|
type: 'object',
|
|
properties: {
|
|
group_id: { type: ['number', 'string'] },
|
|
notice_id: { type: 'string' },
|
|
},
|
|
required: ['group_id', 'notice_id'],
|
|
} as const satisfies JSONSchema;
|
|
|
|
type Payload = FromSchema<typeof SchemaData>;
|
|
|
|
export class DelGroupNotice extends OneBotAction<Payload, any> {
|
|
actionName = ActionName.DelGroupNotice;
|
|
payloadSchema = SchemaData;
|
|
|
|
async _handle(payload: Payload) {
|
|
const group = payload.group_id.toString();
|
|
const noticeId = payload.notice_id;
|
|
return await this.core.apis.GroupApi.deleteGroupBulletin(group, noticeId);
|
|
}
|
|
}
|