From 6b631d84554b068ce6ca311b58bcb60746399531 Mon Sep 17 00:00:00 2001 From: liangho-ng <1330326873@qq.com> Date: Sat, 16 Mar 2024 21:09:13 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8D=E7=B1=B3=E6=B8=B8=E7=A4=BE?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tools.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/tools.js b/apps/tools.js index 0bd4e9c..d861f9b 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -1126,7 +1126,8 @@ export class tools extends plugin { // 米游社 async miyoushe(e) { - let msg = /(?:https?:\/\/)?(m|www)\.miyoushe\.com\/[A-Za-z\d._?%&+\-=\/#]*/.exec(e.msg)[0]; + let url = e.msg === undefined ? e.message.shift().data.replaceAll("\\", "") : e.msg.trim(); + let msg = /(?:https?:\/\/)?(m|www)\.miyoushe\.com\/[A-Za-z\d._?%&+\-=\/#]*/.exec(url)?.[0]; const id = /\/(\d+)$/.exec(msg)?.[0].replace("\/", ""); fetch(MIYOUSHE_ARTICLE.replace("{}", id), {