Merge branch 'ikechan8370:v2' into v2

This commit is contained in:
ifeif 2023-11-24 22:11:27 +08:00 committed by GitHub
commit 9723e6db17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
92 changed files with 4289 additions and 1073 deletions

View file

@ -124,6 +124,11 @@ export class ChatgptManagement extends plugin {
fnc: 'useBardBasedSolution',
permission: 'master'
},
{
reg: '^#chatgpt切换(通义千问|qwen|千问)$',
fnc: 'useQwenSolution',
permission: 'master'
},
{
reg: '^#chatgpt(必应|Bing)切换',
fnc: 'changeBingTone',
@ -294,9 +299,9 @@ ${userSetting.useTTS === true ? '当前语音模式为' + Config.ttsMode : ''}`
const matchCommand = e.msg.match(/^#(chatgpt)?(vits|azure|vox)?语音(服务|角色列表)/)
if (matchCommand[3] === '服务') {
await this.reply(`当前支持vox、vits、azure语音服务可使用'#(vox|azure|vits)语音角色列表'查看支持的语音角色。
vits语音主要有赛马娘原神中文原神日语崩坏 3 的音色结果有随机性语调可能很奇怪
vox语音Voicevox 是一款由日本 DeNA 开发的语音合成软件它可以将文本转换为自然流畅的语音Voicevox 支持多种语言和声音可以用于制作各种语音内容如动画游戏广告等Voicevox 还提供了丰富的调整选项可以调整声音的音调速度音量等参数以满足不同需求除了桌面版软件外Voicevox 还提供了 Web 版本和 API 接口方便开发者在各种平台上使用
azure语音Azure 语音是微软 Azure 平台提供的一项语音服务它可以帮助开发者将语音转换为文本将文本转换为语音实现自然语言理解和对话等功能Azure 语音支持多种语言和声音可以用于构建各种语音应用程序如智能客服语音助手自动化电话系统等Azure 语音还提供了丰富的 API SDK方便开发者在各种平台上集成使用
@ -876,6 +881,7 @@ azure语音Azure 语音是微软 Azure 平台提供的一项语音服务,
await this.reply('当前已经是星火模式了')
}
}
async useAzureBasedSolution () {
let use = await redis.get('CHATGPT:USE')
if (use !== 'azure') {
@ -896,6 +902,16 @@ azure语音Azure 语音是微软 Azure 平台提供的一项语音服务,
}
}
async useQwenSolution () {
let use = await redis.get('CHATGPT:USE')
if (use !== 'qwen') {
await redis.set('CHATGPT:USE', 'qwen')
await this.reply('已切换到基于通义千问的解决方案')
} else {
await this.reply('当前已经是通义千问模式了')
}
}
async changeBingTone (e) {
let tongStyle = e.msg.replace(/^#chatgpt(必应|Bing)切换/, '')
if (!tongStyle) {
@ -1002,7 +1018,7 @@ Poe 模式会调用 Poe 中的 Claude-instant 进行对话。需要提供 Cookie
}
} else if (match) {
const groupId = parseInt(match[1], 10)
if (Bot.getGroupList().get(groupId)) {
if (e.bot.getGroupList().get(groupId)) {
if (await redis.get(`CHATGPT:SHUT_UP:${groupId}`)) {
await redis.del(`CHATGPT:SHUT_UP:${groupId}`)
await redis.set(`CHATGPT:SHUT_UP:${groupId}`, '1', { EX: time })
@ -1052,7 +1068,7 @@ Poe 模式会调用 Poe 中的 Claude-instant 进行对话。需要提供 Cookie
return false
}
const groupId = parseInt(match[1], 10)
if (Bot.getGroupList().get(groupId)) {
if (e.bot.getGroupList().get(groupId)) {
if (await redis.get(`CHATGPT:SHUT_UP:${groupId}`)) {
await redis.del(`CHATGPT:SHUT_UP:${groupId}`)
await e.reply(`好的主人,我终于又可以在群${groupId}和大家聊天了`)
@ -1287,9 +1303,9 @@ Poe 模式会调用 Poe 中的 Claude-instant 进行对话。需要提供 Cookie
const viewHost = Config.serverHost ? `http://${Config.serverHost}/` : `http://${await getPublicIP()}:${Config.serverPort || 3321}/`
const otp = randomString(6)
await redis.set(
`CHATGPT:SERVER_QUICK`,
otp,
{ EX: 60000 }
'CHATGPT:SERVER_QUICK',
otp,
{ EX: 60000 }
)
await this.reply(`请登录http://tools.alcedogroup.com/login?server=${viewHost}&otp=${otp}`, true)
}