From 66c16932501548945e0468e1b8c17bb5d2bf1c8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B2=A9=E6=B5=86?= Date: Sun, 18 Aug 2024 22:48:15 +0800 Subject: [PATCH] fix: no need to check the type of r.reg now /utils/config has already translate it into RegExp. QQ apps usually automatically add a space after each @. --- src/core/index.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/core/index.ts b/src/core/index.ts index cde429b..1618610 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -215,9 +215,7 @@ export class AdapterQQBot implements KarinAdapter { } else { const { regex } = Config.getBotConfig(this.account.uid) || { regex: [] } for (const r of regex) { - const reg = r.reg - if (typeof reg !== 'string') continue - v = v.replace(reg, r.rep) + v = v.trim().replace(r.reg, r.rep) } elements.push(segment.text(v)) }