From cd1f9daed9e1d53736374c0d35d8a12f6f5933ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B2=A9=E6=B5=86?= Date: Fri, 30 Aug 2024 14:35:33 +0800 Subject: [PATCH] fix: type of reg can't be string --- src/core/index.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/index.ts b/src/core/index.ts index 37cc40e..0d4aef2 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -216,8 +216,7 @@ export class AdapterQQBot implements KarinAdapter { 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(reg, r.rep) } elements.push(segment.text(v)) }