mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-06 13:05:09 +00:00
build: 1.5.3-beta1
This commit is contained in:
26
src/onebot11/action/extends/GetCollectionList.ts
Normal file
26
src/onebot11/action/extends/GetCollectionList.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
|
||||
import { NTQQCollectionApi } from '@/core/apis/collection';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { ActionName } from '../types';
|
||||
import { NTQQUserApi } from '@/core/apis';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import { selfInfo } from '@/core/data';
|
||||
|
||||
const SchemaData = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
category: { type: 'number' },
|
||||
count: { type: 'number' }
|
||||
},
|
||||
required: ['category', 'count'],
|
||||
} as const satisfies JSONSchema;
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
export class GetCollectionList extends BaseAction<Payload, any> {
|
||||
actionName = ActionName.GetCollectionList;
|
||||
PayloadSchema = SchemaData;
|
||||
protected async _handle(payload: Payload) {
|
||||
return await NTQQCollectionApi.getAllCollection(payload.category, payload.count);
|
||||
}
|
||||
}
|
||||
@@ -91,5 +91,6 @@ export enum ActionName {
|
||||
OCRImage = 'ocr_image',
|
||||
IOCRImage = '.ocr_image',
|
||||
SetSelfProfile = "set_self_profile",
|
||||
CreateCollection = "create_collection"
|
||||
CreateCollection = "create_collection",
|
||||
GetCollectionList = "get_collection_list"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user