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; export class GetGroupHonorInfo extends OneBotAction { 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); } }