mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-01-03 16:59:08 +08:00
24 lines
783 B
TypeScript
24 lines
783 B
TypeScript
import { WebHonorType } from '@/core';
|
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
|
import { ActionName } from '@/onebot/action/router';
|
|
import { z } from 'zod';
|
|
import { coerce } from '@/common/coerce';
|
|
const SchemaData = z.object({
|
|
group_id: coerce.string(),
|
|
type: z.nativeEnum(WebHonorType).optional()
|
|
});
|
|
|
|
type Payload = z.infer<typeof SchemaData>;
|
|
|
|
export class GetGroupHonorInfo extends OneBotAction<Payload, unknown> {
|
|
override actionName = ActionName.GetGroupHonorInfo;
|
|
override payloadSchema = SchemaData;
|
|
|
|
async _handle(payload: Payload) {
|
|
if (!payload.type) {
|
|
payload.type = WebHonorType.ALL;
|
|
}
|
|
return await this.core.apis.WebApi.getGroupHonorInfo(payload.group_id.toString(), payload.type);
|
|
}
|
|
}
|