mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
✨ feat: 适配汽水音乐
的链接分享
This commit is contained in:
parent
f5aabaea42
commit
70d6f84589
@ -189,6 +189,10 @@ export class tools extends plugin {
|
|||||||
{
|
{
|
||||||
reg: "(y.qq.com)",
|
reg: "(y.qq.com)",
|
||||||
fnc: "qqMusic"
|
fnc: "qqMusic"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
reg: "(qishui.douyin.com)",
|
||||||
|
fnc: "qishuiMusic"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
@ -1790,6 +1794,26 @@ export class tools extends plugin {
|
|||||||
return true;
|
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
|
* @param title
|
||||||
|
Loading…
x
Reference in New Issue
Block a user