fix: type

This commit is contained in:
手瓜一十雪 2024-08-25 23:42:48 +08:00
parent 332fcecb78
commit f6a1b784c4
2 changed files with 8 additions and 7 deletions

View File

@ -21,6 +21,8 @@ import {
OB11MessageData,
OB11MessageDataType,
OB11MessageFileBase,
OB11MessageForward,
OB11MessageReply,
} from '@/onebot';
import { OB11Constructor } from '../helper';
import { EventType } from '@/onebot/event/OB11BaseEvent';
@ -290,7 +292,7 @@ export class OneBotMsgApi {
element.fileSize ?? '0',
element.fileName,
);
return {
type: OB11MessageDataType.video,
data: {
@ -302,7 +304,7 @@ export class OneBotMsgApi {
}
};
},
pttElement: async (element, msg, elementWrapper) => {
await this.coreContext.apis.FileApi.addFileCache(
{
@ -331,12 +333,11 @@ export class OneBotMsgApi {
multiForwardMsgElement: async (_, msg) => {
const NTQQMsgApi = this.coreContext.apis.MsgApi;
const message_data: OB11MessageData = {
const message_data: OB11MessageForward = {
data: {} as any,
type: 'unknown' as any,
type: OB11MessageDataType.forward,
};
message_data['type'] = OB11MessageDataType.forward;
message_data['data']['id'] = msg.msgId;
message_data.data.id = msg.msgId;
const parentMsgPeer = msg.parentMsgPeer ?? {
chatType: msg.chatType,
guildId: '',

View File

@ -156,7 +156,7 @@ export interface OB11MessageCustomMusic {
export interface OB11MessageJson {
type: OB11MessageDataType.json;
data: { config: { token: string }, data: string };
data: { config?: { token: string }, data: string };
}
export interface OB11MessageDice {