Feat/Implement QQ Online File/Folder and Flash Transfer support (#1541)
* feat: implement QQ online file transfer and flash transfer support * fix: change OnlineFile OB11Message data * fix: add fileSize and isDir to OB11MessageOnlineFile * fix: resolve typescript strict mode errors
This commit is contained in:
1 parent
772f07c58b
commit
75236dd50c
35 files changed
+1831
-23
No files matched your search
@@ -0,0 +1,24 @@
|
||||
import { OneBotAction } from '@/napcat-onebot/action/OneBotAction';
|
||||
import { ActionName } from '@/napcat-onebot/action/router';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
|
||||
// 不全部使用json因为:一个文件解析Form-data会变字符串!!! 但是api文档就写List
|
||||
const SchemaData = Type.Object({
|
||||
files: Type.Union([
|
||||
Type.Array(Type.String()),
|
||||
Type.String(),
|
||||
]),
|
||||
});
|
||||
type Payload = Static<typeof SchemaData>;
|
||||
|
||||
export class CreateFlashTask extends OneBotAction<Payload, unknown> {
|
||||
override actionName = ActionName.CreateFlashTask;
|
||||
override payloadSchema = SchemaData;
|
||||
|
||||
async _handle (payload: Payload) {
|
||||
// todo fileset的名字和缩略图还没实现!!
|
||||
const fileList = Array.isArray(payload.files) ? payload.files : [payload.files];
|
||||
|
||||
return await this.core.apis.FlashApi.createFlashTransferUploadTask(fileList);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user