From 7431814d1e895f8e8873610605d5d6d39294156b Mon Sep 17 00:00:00 2001 From: ikechan8370 Date: Mon, 7 Apr 2025 15:07:15 +0800 Subject: [PATCH] fix: reg --- utils/command.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/utils/command.js b/utils/command.js index 6671738..38e628e 100644 --- a/utils/command.js +++ b/utils/command.js @@ -122,9 +122,8 @@ export function createCRUDCommandRules (cmdPrefix, name, variable, detail = true fnc: `importCloud${upperVariable}` }) this[`importCloud${upperVariable}`] = async function (e) { - const match = e.msg.match(new RegExp(cmdPrefix + `导入${name}`)) - if (match) { - const id = match[1].trim() + const id = e.msg.replace(new RegExp(cmdPrefix + `导入${name}`), '') + if (id) { const instance = await manager.getInstanceByCloudId(id) if (instance) { e.reply(`${name}已存在,尝试导入最新版本`, true)