From 6ae4f1cfd2d60ac13d84f6904b70bc0de335f7d1 Mon Sep 17 00:00:00 2001 From: takayama Date: Tue, 17 May 2022 17:35:31 +0900 Subject: [PATCH] fix toCqcode --- lib/message/message.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/message/message.ts b/lib/message/message.ts index 1e831390..f359840e 100644 --- a/lib/message/message.ts +++ b/lib/message/message.ts @@ -419,7 +419,7 @@ function genCqcode(content: MessageElem[]) { continue } const tmp = { ...elem } as Partial - tmp.type = undefined + delete tmp.type const str = qs.stringify(tmp as NodeJS.Dict, ",", "=", { encodeURIComponent: (s) => s.replace(/&|,|\[|\]/g, escapeCQInside) }) cqcode += "[CQ:" + elem.type + (str ? "," : "") + str + "]" }