From 66f30e1ebfe3888db5ab084bccc0d9de57a2ad27 Mon Sep 17 00:00:00 2001 From: 837951602 <837951602@qq.com> Date: Tue, 16 Sep 2025 17:19:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=BE=E4=B8=8D=E5=88=B0=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=97=B6=E6=98=BE=E5=BC=8F=E6=8A=A5=E9=94=99=20(#1256)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/onebot/api/msg.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/onebot/api/msg.ts b/src/onebot/api/msg.ts index cd6a5e98..0a3be50d 100644 --- a/src/onebot/api/msg.ts +++ b/src/onebot/api/msg.ts @@ -1124,10 +1124,13 @@ export class OneBotMsgApi { if (ignoreTypes.includes(sendMsg.type)) { continue; } - const converter = this.ob11ToRawConverters[sendMsg.type] as ( + const converter = this.ob11ToRawConverters[sendMsg.type] as (( sendMsg: Extract, context: SendMessageContext, - ) => Promise; + ) => Promise) | undefined; + if (converter == undefined) { + throw new Error('未知的消息类型:' + sendMsg.type); + } const callResult = converter( sendMsg, { peer, deleteAfterSentFiles },