From 9df10b9bb4470dfc1d87cedb56be8baebf72b3b1 Mon Sep 17 00:00:00 2001 From: sameu Date: Mon, 14 Aug 2023 02:40:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A1=A8=E6=83=85=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E6=AD=A3=E5=BA=8F=E8=BE=93=E5=87=BA=EF=BC=8C?= =?UTF-8?q?=E6=AF=8F=E4=B8=AA=E8=A1=A8=E6=83=85=E5=8D=95=E7=8B=AC=E4=B8=80?= =?UTF-8?q?=E6=9D=A1=E6=B6=88=E6=81=AF=20(#222)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/system/add.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/plugins/system/add.js b/plugins/system/add.js index 9568688..368bd51 100644 --- a/plugins/system/add.js +++ b/plugins/system/add.js @@ -712,16 +712,17 @@ export class add extends plugin { let keyWord = await this.keyWordTran(arr[i].key) if (!keyWord) continue - + let result = [] if (Array.isArray(keyWord)) { - keyWord.unshift(`${arr[i].num}、`) + keyWord.unshift(`${num + 1}、`) keyWord.push('\n') - keyWord.forEach(v => msg.push(v)) + result.push(...keyWord) } else if (keyWord.type) { - msg.push(`\n${arr[i].num}、`, keyWord, '\n\n') + result.push(`\n${num + 1}、`, keyWord, '\n\n') } else { - msg.push(`${arr[i].num}、${keyWord}\n`) + result.push(`${num + 1}、${keyWord}\n`) } + msg.push(result) num++ } @@ -734,7 +735,7 @@ export class add extends plugin { title = `表情${search},${count}条` } - let forwardMsg = await common.makeForwardMsg(this.e, [title, msg], title) + let forwardMsg = await common.makeForwardMsg(this.e, [title, ...msg], title) this.e.reply(forwardMsg) } @@ -778,4 +779,4 @@ export class add extends plugin { return msg } -} \ No newline at end of file +}