新增:加入高清语音,回复“#chatgpt开启高清语音”来开启

1.新增:加入高清语音,回复“#chatgpt开启高清语音”来开启
2.优化:语音模式下遇到超长文本将会使用图片模式
This commit is contained in:
ifeif 2023-05-14 20:47:10 +08:00
parent 15f579aab8
commit 3364dbd89d
4 changed files with 73 additions and 14 deletions

View file

@ -1113,7 +1113,7 @@ export class chatgpt extends plugin {
for (let quote of quotemessage) {
if (quote.imageLink) imgUrls.push(quote.imageLink)
}
if (useTTS) {
if (useTTS && response.length <= Config.autoUsePictureThreshold {
// 缓存数据
this.cacheContent(e, use, response, prompt, quotemessage, mood, chatMessage.suggestedResponses, imgUrls)
if (response === 'Thanks for this conversation! I\'ve reached my limit, will you hit “New topic,” please?') {

View file

@ -184,6 +184,11 @@ export class ChatgptManagement extends plugin {
fnc: 'setDefaultReplySetting',
permission: 'master'
},
{
reg: '^#chatgpt(开启|关闭)高清语音',
fnc: 'enableTtsHD',
permission: 'master'
},
{
/** 命令正则匹配 */
reg: '^#(关闭|打开)群聊上下文$',
@ -483,7 +488,14 @@ export class ChatgptManagement extends plugin {
await this.reply('设置成功', e.isGroup)
return false
}
async enableTtsHD (e) {
Config.ttsHD = e.msg.indexOf('开启') > -1
if(Config.ttsHD) {
await this.reply('已开启高清语音,电脑端将无法播放语音', true)
} else {
await this.reply('已关闭高清语音', true)
}
}
async enableGroupContext (e) {
const reg = /(关闭|打开)/
const match = e.msg.match(reg)