mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 13:57:10 +00:00
Merge branch 'v2' into v2
This commit is contained in:
commit
0daecc2edb
5 changed files with 68 additions and 64 deletions
15
apps/chat.js
15
apps/chat.js
|
|
@ -9,6 +9,7 @@ import SydneyAIClient from '../utils/SydneyAIClient.js'
|
|||
import { PoeClient } from '../utils/poe/index.js'
|
||||
import AzureTTS from '../utils/tts/microsoft-azure.js'
|
||||
import VoiceVoxTTS from '../utils/tts/voicevox.js'
|
||||
import fs from 'fs'
|
||||
import {
|
||||
render, renderUrl,
|
||||
getMessageById,
|
||||
|
|
@ -119,11 +120,11 @@ export class chatgpt extends plugin {
|
|||
permission: 'master'
|
||||
},
|
||||
{
|
||||
reg: '^#(chatgpt)?结束对话([sS]*)',
|
||||
reg: '^#(chatgpt)?(结束|新开|摧毁|毁灭|完结)对话([sS]*)',
|
||||
fnc: 'destroyConversations'
|
||||
},
|
||||
{
|
||||
reg: '^#(chatgpt)?结束全部对话$',
|
||||
reg: '^#(chatgpt)?(结束|新开|摧毁|毁灭|完结)全部对话$',
|
||||
fnc: 'endAllConversations',
|
||||
permission: 'master'
|
||||
},
|
||||
|
|
@ -1046,7 +1047,7 @@ export class chatgpt extends plugin {
|
|||
}
|
||||
try {
|
||||
try {
|
||||
let sendable = await uploadRecord(wav)
|
||||
let sendable = await uploadRecord(wav, Config.ttsMode === 'azure')
|
||||
if (sendable) {
|
||||
await e.reply(sendable)
|
||||
} else {
|
||||
|
|
@ -1061,6 +1062,14 @@ export class chatgpt extends plugin {
|
|||
logger.error(err)
|
||||
await this.reply('合成语音发生错误~')
|
||||
}
|
||||
if (Config.ttsMode === 'azure' && Config.azureTTSKey) {
|
||||
// 清理文件
|
||||
try {
|
||||
fs.unlinkSync(wav)
|
||||
} catch (err) {
|
||||
logger.warn(err)
|
||||
}
|
||||
}
|
||||
} else if (userSetting.usePicture || (Config.autoUsePicture && response.length > Config.autoUsePictureThreshold)) {
|
||||
// todo use next api of chatgpt to complete incomplete respoonse
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue