import { FromSchema, JSONSchema } from 'json-schema-to-ts'; import BaseAction from '../BaseAction'; import { ActionName } from '../types'; const SchemaData = { type: 'object', properties: { group_id: { type: ['string', 'number'] }, }, required: ['group_id'], } as const satisfies JSONSchema; type Payload = FromSchema; export class GetGroupFileSystemInfo extends BaseAction { actionName = ActionName.GoCQHTTP_GetGroupFileSystemInfo; payloadSchema = SchemaData; async _handle(payload: Payload) { return { file_count: (await this.core.apis.GroupApi .getGroupFileCount([payload.group_id.toString()])) .groupFileCounts[0], limit_count: 10000, used_space: 0, total_space: 10 * 1024 * 1024 * 1024, }; } }