Merge branch 'ikechan8370:v2' into v2

This commit is contained in:
ifeif 2023-08-29 15:31:12 +08:00 committed by GitHub
commit d0b5585539
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 1265 additions and 98 deletions

View file

@ -108,6 +108,16 @@ export class ChatgptManagement extends plugin {
fnc: 'useXinghuoBasedSolution',
permission: 'master'
},
{
reg: '^#chatgpt切换azure$',
fnc: 'useAzureBasedSolution',
permission: 'master'
},
{
reg: '^#chatgpt切换(Bard|bard)$',
fnc: 'useBardBasedSolution',
permission: 'master'
},
{
reg: '^#chatgpt(必应|Bing)切换',
fnc: 'changeBingTone',
@ -845,6 +855,25 @@ azure语音Azure 语音是微软 Azure 平台提供的一项语音服务,
await this.reply('当前已经是星火模式了')
}
}
async useAzureBasedSolution () {
let use = await redis.get('CHATGPT:USE')
if (use !== 'azure') {
await redis.set('CHATGPT:USE', 'azure')
await this.reply('已切换到基于Azure的解决方案')
} else {
await this.reply('当前已经是Azure模式了')
}
}
async useBardBasedSolution () {
let use = await redis.get('CHATGPT:USE')
if (use !== 'bard') {
await redis.set('CHATGPT:USE', 'bard')
await this.reply('已切换到基于Bard的解决方案')
} else {
await this.reply('当前已经是Bard模式了')
}
}
async changeBingTone (e) {
let tongStyle = e.msg.replace(/^#chatgpt(必应|Bing)切换/, '')
@ -891,6 +920,7 @@ azure语音Azure 语音是微软 Azure 平台提供的一项语音服务,
let mode = await redis.get('CHATGPT:USE')
const modeMap = {
browser: '浏览器',
azure: 'Azure',
// apiReverse: 'API2',
api: 'API',
bing: '必应',