mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
commit
acfa39520a
@ -34,6 +34,8 @@ export class songRequest extends plugin {
|
||||
this.toolsConfig = config.getConfig("tools");
|
||||
// 加载网易云Cookie
|
||||
this.neteaseCookie = this.toolsConfig.neteaseCookie
|
||||
// 加载是否转化群语音
|
||||
this.isSendVocal = this.toolsConfig.isSendVocal
|
||||
// 加载是否自建服务器
|
||||
this.useLocalNeteaseAPI = this.toolsConfig.useLocalNeteaseAPI
|
||||
// 加载自建服务器API
|
||||
@ -316,8 +318,12 @@ export class songRequest extends plugin {
|
||||
logger.error("发送卡片错误错误,请查看控制台报错,将发送群语音")
|
||||
logger.error(error)
|
||||
}
|
||||
// 发送群文件
|
||||
await this.uploadGroupFile(e, path);
|
||||
// 删除文件
|
||||
await checkAndRemoveFile(path);
|
||||
// 发送语音
|
||||
if (musicExt != 'mp4') {
|
||||
if (musicExt != 'mp4' && this.isSendVocal) {
|
||||
await e.reply(segment.record(path));
|
||||
}
|
||||
}
|
||||
|
@ -270,6 +270,8 @@ export class tools extends plugin {
|
||||
this.biliCDN = this.toolsConfig.biliCDN;
|
||||
// 加载网易云Cookie
|
||||
this.neteaseCookie = this.toolsConfig.neteaseCookie
|
||||
// 加载是否转化群语音
|
||||
this.isSendVocal = this.toolsConfig.isSendVocal
|
||||
// 加载是否自建服务器
|
||||
this.useLocalNeteaseAPI = this.toolsConfig.useLocalNeteaseAPI
|
||||
// 加载自建服务器API
|
||||
@ -1791,7 +1793,7 @@ export class tools extends plugin {
|
||||
// 下载音乐
|
||||
downloadAudio(url, this.getCurDownloadPath(e), title, 'follow', musicExt).then(async path => {
|
||||
// 发送语音
|
||||
if (musicExt != 'mp4') {
|
||||
if (musicExt != 'mp4' && this.isSendVocal) {
|
||||
await e.reply(segment.record(path));
|
||||
}
|
||||
// 上传群文件
|
||||
@ -2248,7 +2250,9 @@ export class tools extends plugin {
|
||||
// 下载音乐
|
||||
downloadAudio(url, this.getCurDownloadPath(e), title, 'follow').then(async path => {
|
||||
// 发送语音
|
||||
if (this.isSendVocal) {
|
||||
await e.reply(segment.record(path));
|
||||
}
|
||||
// 判断是不是icqq
|
||||
await this.uploadGroupFile(e, path);
|
||||
await checkAndRemoveFile(path);
|
||||
@ -2380,7 +2384,9 @@ export class tools extends plugin {
|
||||
// 下载音乐
|
||||
await downloadAudio(url, this.getCurDownloadPath(e), musicInfo, 'follow').then(async path => {
|
||||
// 发送语音
|
||||
if (this.isSendVocal) {
|
||||
await e.reply(segment.record(path));
|
||||
}
|
||||
// 判断是不是icqq
|
||||
await this.uploadGroupFile(e, path);
|
||||
await checkAndRemoveFile(path);
|
||||
@ -2400,7 +2406,9 @@ export class tools extends plugin {
|
||||
// 下载音乐
|
||||
await downloadAudio(url, this.getCurDownloadPath(e), musicInfo, 'follow').then(async path => {
|
||||
// 发送语音
|
||||
if (this.isSendVocal) {
|
||||
await e.reply(segment.record(path));
|
||||
}
|
||||
// 判断是不是icqq
|
||||
await this.uploadGroupFile(e, path);
|
||||
await checkAndRemoveFile(path);
|
||||
|
@ -24,6 +24,7 @@ biliResolution: 1 # 哔哩哔哩的下载画质,0为原画,1为清晰画,2
|
||||
|
||||
useLocalNeteaseAPI: false # 是否使用网易云解析自建API
|
||||
useNeteaseSongRequest: false # 是否开启网易云点歌功能
|
||||
isSendVocal: true # 是否开启发送群语音
|
||||
songRequestMaxList: 10 # 网易云点歌请求最大列表数
|
||||
neteaseCookie: '' # 网易云ck
|
||||
neteaseCloudAPIServer: '' # 网易云自建服务器地址
|
||||
|
@ -268,6 +268,14 @@ export function supportGuoba() {
|
||||
component: "Switch",
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
field: "tools.isSendVocal",
|
||||
label: "开启转语音",
|
||||
bottomHelpMessage:
|
||||
"默认开启,识别音乐之后是否转化群语音发送,关闭将获得一定的性能提升",
|
||||
component: "Switch",
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
field: "tools.songRequestMaxList",
|
||||
label: "点歌列表长度",
|
||||
|
Loading…
x
Reference in New Issue
Block a user