style: 强类型大法

This commit is contained in:
手瓜一十雪
2025-02-02 23:22:21 +08:00
parent 76501bae34
commit 70945cf2d8
191 changed files with 923 additions and 806 deletions

View File

@@ -14,15 +14,16 @@ export class GetGroupFileSystemInfo extends OneBotAction<Payload, {
used_space: number, // TODO:unimplemented, but can be implemented later
total_space: number, // unimplemented, 10 GB by default
}> {
actionName = ActionName.GoCQHTTP_GetGroupFileSystemInfo;
payloadSchema = SchemaData;
override actionName = ActionName.GoCQHTTP_GetGroupFileSystemInfo;
override payloadSchema = SchemaData;
async _handle(payload: Payload) {
const groupFileCount = (await this.core.apis.GroupApi.getGroupFileCount([payload.group_id.toString()])).groupFileCounts[0];
if (!groupFileCount) {
throw new Error('Group not found');
}
return {
file_count:
(await this.core.apis.GroupApi
.getGroupFileCount([payload.group_id.toString()]))
.groupFileCounts[0],
file_count: groupFileCount,
limit_count: 10000,
used_space: 0,
total_space: 10 * 1024 * 1024 * 1024,