From 40ea2c01ea84f72ee6439655eb5f31f8f11fd3bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E5=88=80=E9=B1=BC?= <9903082+qdyovo@user.noreply.gitee.com> Date: Wed, 13 Nov 2024 16:34:16 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A6=84=20reactor:=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=E8=AF=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/songRequest.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/songRequest.js b/apps/songRequest.js index 44dc1f2..0d54483 100644 --- a/apps/songRequest.js +++ b/apps/songRequest.js @@ -57,7 +57,7 @@ export class songRequest extends plugin { permission: 'master' }, { - reg: '^#?获取群文件$', + reg: '^#?群文件上传云盘$|#rngu|#RNGU', fnc: 'getLatestDocument', permission: 'master' } @@ -411,17 +411,15 @@ export class songRequest extends plugin { async getLatestDocument(e) { const autoSelectNeteaseApi = await this.pickApi() const cleanPath = await getGroupFileUrl(e) - logger.info(cleanPath) // 拓展名 const extension = cleanPath.match(/\.\w+$/); // 获取文件路径 const dirPath = cleanPath.substring(0, cleanPath.lastIndexOf('/')); // 获取文件名 const fileName = cleanPath.split('/').pop().replace(/\.\w+$/, ''); - logger.info(fileName) + // 进行文件名拆解 const parts = fileName.trim().match(/^([\s\S]+)\s*-\s*([\s\S]+)$/); - logger.info(parts) - const newFileName = dirPath + '/' + parts[2].trim() + extension + const newFileName = dirPath + '/' + parts[2].replace(/^\s+|\s+$/g, '') + extension // 进行元数据编辑 if (parts) { const tags = {