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