From d890b7829071ac627043cb5cf8f927d9bdf16495 Mon Sep 17 00:00:00 2001 From: linyuchen Date: Tue, 16 Apr 2024 23:22:37 +0800 Subject: [PATCH] refactor: auto_escape of send msg --- src/onebot11/action/msg/SendMsg.ts | 2 +- src/onebot11/types.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/onebot11/action/msg/SendMsg.ts b/src/onebot11/action/msg/SendMsg.ts index 1bc1999a3..c7b0a002f 100644 --- a/src/onebot11/action/msg/SendMsg.ts +++ b/src/onebot11/action/msg/SendMsg.ts @@ -329,7 +329,7 @@ export class SendMsg extends BaseAction { } else { throw ('发送消息参数错误, 请指定group_id或user_id'); } - const messages = convertMessage2List(payload.message, payload.auto_escape); + const messages = convertMessage2List(payload.message, payload.auto_escape === true || payload.auto_escape === 'true'); if (this.getSpecialMsgNum(payload, OB11MessageDataType.node)) { try { const returnMsg = await this.handleForwardNode(peer, messages as OB11MessageNode[], group); diff --git a/src/onebot11/types.ts b/src/onebot11/types.ts index 6a6f57b23..d4835650b 100644 --- a/src/onebot11/types.ts +++ b/src/onebot11/types.ts @@ -243,7 +243,7 @@ export interface OB11PostSendMsg { group_id?: string, message: OB11MessageMixType; messages?: OB11MessageMixType; // 兼容 go-cqhttp - auto_escape?: boolean + auto_escape?: boolean | string } export interface OB11Version {