Files
NapCatQQ/src/onebot/action/extends/UploadForwardMsg.ts

40 lines
1.2 KiB
TypeScript

import BaseAction from '../BaseAction';
import { ActionName } from '../types';
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
import {PacketMsgTextElement} from "@/core/packet/msg/element";
import {SendTextElement} from "@/core";
const SchemaData = {
type: 'object',
properties: {
group_id: { type: ['number', 'string'] },
},
required: ['group_id'],
}as const satisfies JSONSchema;
type Payload = FromSchema<typeof SchemaData>;
export class UploadForwardMsg extends BaseAction<Payload, any> {
actionName = ActionName.UploadForwardMsg;
payloadSchema = SchemaData;
async _handle(payload: Payload) {
if (!this.core.apis.PacketApi.packetClient?.available) {
throw new Error('PacketClient is not init');
}
throw new Error('Not implemented');
// return await this.core.apis.PacketApi.sendUploadForwardMsg([{
// groupId: 0,
// senderId: 0,
// senderName: "NapCat",
// time: Math.floor(Date.now() / 1000),
// msg: [new PacketMsgTextElement({
// textElement: {
// content: "Nya~"
// }
// } as SendTextElement)]
// }], 0);
}
}