mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 08:09:19 +00:00
✨ feat:新增锅巴配置项
This commit is contained in:
parent
29eae820a8
commit
66ea0e2319
@ -37,17 +37,25 @@ export class songRequest extends plugin {
|
||||
this.neteaseCloudAudioQuality = this.toolsConfig.neteaseCloudAudioQuality
|
||||
// 加载识别前缀
|
||||
this.identifyPrefix = this.toolsConfig.identifyPrefix;
|
||||
// 加载是否开启网易云点歌功能
|
||||
this.useNeteaseSongRequest = this.toolsConfig.useNeteaseSongRequest
|
||||
// 加载点歌列表长度
|
||||
this.songRequestMaxList = this.toolsConfig.songRequestMaxList
|
||||
}
|
||||
|
||||
async pickSong(e) {
|
||||
// 判断功能是否开启
|
||||
if(!this.useNeteaseSongRequest) return
|
||||
const autoSelectNeteaseApi = await this.pickApi()
|
||||
// 只在群里可以使用
|
||||
let group_id = e.group.group_id
|
||||
if (!group_id) return
|
||||
// 初始化
|
||||
let songInfo = await redisGetKey(REDIS_YUNZAI_SONGINFO)
|
||||
const saveId = songInfo.findIndex(item => item.group_id === e.group.group_id)
|
||||
let musicDate = { 'group_id': group_id, data: [] }
|
||||
// 获取搜索歌曲列表信息
|
||||
let searchUrl = autoSelectNeteaseApi + '/search?keywords={}&limit=10' //搜索API
|
||||
let searchUrl = autoSelectNeteaseApi + '/search?keywords={}&limit='+ this.songRequestMaxList //搜索API
|
||||
let detailUrl = autoSelectNeteaseApi + "/song/detail?ids={}" //歌曲详情API
|
||||
if (e.msg.replace(/\s+/g, "").match(/点歌(.+)/)) {
|
||||
const songKeyWord = e.msg.replace(/\s+/g, "").match(/点歌(.+)/)[1]
|
||||
@ -111,6 +119,10 @@ export class songRequest extends plugin {
|
||||
|
||||
// 播放策略
|
||||
async playSong(e) {
|
||||
if(!this.useNeteaseSongRequest) return
|
||||
// 只在群里可以使用
|
||||
let group_id = e.group.group_id
|
||||
if (!group_id) return
|
||||
const autoSelectNeteaseApi = await this.pickApi()
|
||||
let songInfo = []
|
||||
// 获取搜索歌曲列表信息
|
||||
|
@ -23,6 +23,8 @@ biliDownloadMethod: 0 # 哔哩哔哩的下载方式:0默认使用原生稳定
|
||||
biliResolution: 1 # 哔哩哔哩的下载画质,0为原画,1为清晰画,2为流畅画(默认为0)
|
||||
|
||||
useLocalNeteaseAPI: false # 是否使用网易云解析自建API
|
||||
useNeteaseSongRequest: false # 是否开启网易云点歌功能
|
||||
songRequestMaxList: 10 # 网易云点歌请求最大列表数
|
||||
neteaseCookie: '' # 网易云ck
|
||||
neteaseCloudAPIServer: '' # 网易云自建服务器地址
|
||||
neteaseCloudAudioQuality: exhigh # 网易云解析最高音质 默认exhigh(极高) 分类:standard => 标准,higher => 较高, exhigh=>极高, lossless=>无损, hires=>Hi-Res, jyeffect => 高清环绕声, sky => 沉浸环绕声, dolby => 杜比全景声, jymaster => 超清母带
|
||||
|
@ -260,6 +260,25 @@ export function supportGuoba() {
|
||||
component: "Switch",
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
field: "tools.useNeteaseSongRequest",
|
||||
label: "开启网易云点歌功能",
|
||||
bottomHelpMessage:
|
||||
"默认不开启,建议搭配自建网易云API使用,以获得最佳体验",
|
||||
component: "Switch",
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
field: "tools.songRequestMaxList",
|
||||
label: "点歌列表长度",
|
||||
bottomHelpMessage:
|
||||
"网易云点歌选择列表长度默认10",
|
||||
component: "InputNumber",
|
||||
required: false,
|
||||
componentProps: {
|
||||
placeholder: "填入长度",
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "tools.neteaseCloudAPIServer",
|
||||
label: "自建网易云API地址",
|
||||
|
Loading…
x
Reference in New Issue
Block a user