From 70d6f845896a9a1287aafe32b95def6f8411aba5 Mon Sep 17 00:00:00 2001 From: zhiyu1998 <542716863@qq.com> Date: Fri, 2 Aug 2024 09:50:54 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=E9=80=82=E9=85=8D`?= =?UTF-8?q?=E6=B1=BD=E6=B0=B4=E9=9F=B3=E4=B9=90`=E7=9A=84=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E5=88=86=E4=BA=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tools.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/apps/tools.js b/apps/tools.js index d0bd8c1..cf8a337 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -189,6 +189,10 @@ export class tools extends plugin { { reg: "(y.qq.com)", fnc: "qqMusic" + }, + { + reg: "(qishui.douyin.com)", + fnc: "qishuiMusic" } ], }); @@ -1790,6 +1794,26 @@ export class tools extends plugin { return true; } + // 汽水音乐 + async qishuiMusic(e) { + const normalRegex = /^(.*?)\s*https?:\/\//; + const musicInfo = normalRegex.exec(e.msg)?.[1].trim(); + logger.info(`[R插件][qishuiMusic] 识别音乐为:${musicInfo}`); + // 使用临时接口下载 + const url = await this.musicTempApi(e, musicInfo, "汽水音乐"); + // 下载音乐 + await downloadAudio(url, this.getCurDownloadPath(e), musicInfo, 'follow').then(async path => { + // 发送语音 + await e.reply(segment.record(path)); + // 判断是不是icqq + await this.uploadGroupFile(e, path); + await checkAndRemoveFile(path); + }).catch(err => { + logger.error(`下载音乐失败,错误信息为: ${ err.message }`); + }); + return true; + } + /** * 哔哩哔哩下载 * @param title