From 0c05297dbf8f555db69b215ded6803ec4757886f Mon Sep 17 00:00:00 2001 From: ycxom Date: Fri, 3 Jan 2025 22:21:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Bug=20-=20AT=20=E5=BC=82=E5=B8=B8=20-=20?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E8=BF=87=E6=BB=A4=E9=80=BB=E8=BE=91=E4=BB=A5?= =?UTF-8?q?=E5=A4=84=E7=90=86=E7=A9=BA=E5=93=8D=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/bym.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/bym.js b/apps/bym.js index 8833aac..447ef7b 100644 --- a/apps/bym.js +++ b/apps/bym.js @@ -363,9 +363,9 @@ export class bym extends plugin { } else { let finalMsg = await convertFaces(t, true, e) finalMsg = finalMsg.map(filterResponseChunk).filter(i => !!i) - // if (!finalMsg || (typeof finalMsg === 'string' && !finalMsg.trim())) { - // continue - // } + if (!finalMsg.length || (JSON.stringify(finalMsg).trim() === '')) { + continue + } logger.info(JSON.stringify(finalMsg)) if (Math.floor(Math.random() * 100) < 10) { await e.reply(finalMsg, true, { @@ -393,7 +393,10 @@ export class bym extends plugin { * 过滤 * @param msg */ -function filterResponseChunk (msg) { +function filterResponseChunk(msg) { + if (typeof msg === 'object') { + return msg || false + } if (!msg || typeof msg !== 'string') { return false } @@ -409,7 +412,7 @@ function filterResponseChunk (msg) { return msg } -function customSplitRegex (text, regex, limit) { +function customSplitRegex(text, regex, limit) { const result = [] let match let lastIndex = 0