mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 21:37:11 +00:00
Merge branch 'v2' of https://github.com/ikechan8370/chatgpt-plugin into v2
This commit is contained in:
commit
407b3752a4
11 changed files with 245 additions and 183 deletions
|
|
@ -1207,8 +1207,8 @@ export class chatgpt extends plugin {
|
|||
// 处理多行回复有时候只会读第一行和azure语音会读出一些标点符号的问题
|
||||
ttsResponse = ttsResponse.replace(/[-:_;*;\n]/g, ',')
|
||||
// 先把文字回复发出去,避免过久等待合成语音
|
||||
if (Config.alsoSendText || ttsResponse.length > Config.ttsAutoFallbackThreshold) {
|
||||
if (Config.ttsMode === 'vits-uma-genshin-honkai' && ttsResponse.length > Config.ttsAutoFallbackThreshold) {
|
||||
if (Config.alsoSendText || ttsResponse.length > parseInt(Config.ttsAutoFallbackThreshold)) {
|
||||
if (Config.ttsMode === 'vits-uma-genshin-honkai' && ttsResponse.length > parseInt(Config.ttsAutoFallbackThreshold)) {
|
||||
await this.reply('回复的内容过长,已转为文本模式')
|
||||
}
|
||||
await this.reply(await convertFaces(response, Config.enableRobotAt, e), e.isGroup)
|
||||
|
|
@ -1441,7 +1441,7 @@ export class chatgpt extends plugin {
|
|||
let cacheData = await this.cacheContent(e, use, content, prompt, quote, mood, suggest, imgUrls)
|
||||
const template = use !== 'bing' ? 'content/ChatGPT/index' : 'content/Bing/index'
|
||||
if (!Config.oldview) {
|
||||
if (cacheData.error || cacheData.status != 200) { await this.reply(`出现错误:${cacheData.error || 'server error ' + cacheData.status}`, true) } else { await e.reply(await renderUrl(e, (Config.viewHost ? `${Config.viewHost}/` : `http://127.0.0.1:${Config.serverPort || 3321}/`) + `page/${cacheData.file}?qr=${Config.showQRCode ? 'true' : 'false'}`, { retType: Config.quoteReply ? 'base64' : '', Viewport: { width: Config.chatViewWidth, height: parseInt(Config.chatViewWidth * 0.56) }, func: (Config.live2d && !Config.viewHost) ? 'window.Live2d == true' : '', deviceScaleFactor: Config.cloudDPR }), e.isGroup && Config.quoteReply) }
|
||||
if (cacheData.error || cacheData.status != 200) { await this.reply(`出现错误:${cacheData.error || 'server error ' + cacheData.status}`, true) } else { await e.reply(await renderUrl(e, (Config.viewHost ? `${Config.viewHost}/` : `http://127.0.0.1:${Config.serverPort || 3321}/`) + `page/${cacheData.file}?qr=${Config.showQRCode ? 'true' : 'false'}`, { retType: Config.quoteReply ? 'base64' : '', Viewport: { width: parseInt(Config.chatViewWidth), height: parseInt(parseInt(Config.chatViewWidth) * 0.56) }, func: (parseFloat(Config.live2d) && !Config.viewHost) ? 'window.Live2d == true' : '', deviceScaleFactor: parseFloat(Config.cloudDPR) }), e.isGroup && Config.quoteReply) }
|
||||
} else {
|
||||
if (Config.cacheEntry) cacheData.file = randomString()
|
||||
const cacheresOption = {
|
||||
|
|
|
|||
|
|
@ -490,7 +490,7 @@ ${translateLangLabels}
|
|||
width: Config.chatViewWidth,
|
||||
height: parseInt(Config.chatViewWidth * 0.56)
|
||||
},
|
||||
deviceScaleFactor: Config.cloudDPR
|
||||
deviceScaleFactor: parseFloat(Config.cloudDPR)
|
||||
}
|
||||
),
|
||||
e.isGroup && Config.quoteReply)
|
||||
|
|
|
|||
|
|
@ -29,42 +29,42 @@ export class ChatgptManagement extends plugin {
|
|||
priority: 500,
|
||||
rule: [
|
||||
{
|
||||
reg: '#chatgpt开启(问题)?(回复)?确认',
|
||||
reg: '^#chatgpt开启(问题)?(回复)?确认',
|
||||
fnc: 'turnOnConfirm',
|
||||
permission: 'master'
|
||||
},
|
||||
{
|
||||
reg: '#chatgpt关闭(问题)?(回复)?确认',
|
||||
reg: '^#chatgpt关闭(问题)?(回复)?确认',
|
||||
fnc: 'turnOffConfirm',
|
||||
permission: 'master'
|
||||
},
|
||||
{
|
||||
reg: '#chatgpt(设置|绑定)(token|Token)',
|
||||
reg: '^#chatgpt(设置|绑定)(token|Token)',
|
||||
fnc: 'setAccessToken',
|
||||
permission: 'master'
|
||||
},
|
||||
{
|
||||
reg: '#chatgpt(设置|绑定)(Poe|POE)(token|Token)',
|
||||
reg: '^#chatgpt(设置|绑定)(Poe|POE)(token|Token)',
|
||||
fnc: 'setPoeCookie',
|
||||
permission: 'master'
|
||||
},
|
||||
{
|
||||
reg: '#chatgpt(设置|绑定|添加)(必应|Bing |bing )(token|Token)',
|
||||
reg: '^#chatgpt(设置|绑定|添加)(必应|Bing |bing )(token|Token)',
|
||||
fnc: 'setBingAccessToken',
|
||||
permission: 'master'
|
||||
},
|
||||
{
|
||||
reg: '#chatgpt(删除|移除)(必应|Bing |bing )(token|Token)',
|
||||
reg: '^#chatgpt(删除|移除)(必应|Bing |bing )(token|Token)',
|
||||
fnc: 'delBingAccessToken',
|
||||
permission: 'master'
|
||||
},
|
||||
{
|
||||
reg: '#chatgpt(查看|浏览)(必应|Bing |bing )(token|Token)',
|
||||
reg: '^#chatgpt(查看|浏览)(必应|Bing |bing )(token|Token)',
|
||||
fnc: 'getBingAccessToken',
|
||||
permission: 'master'
|
||||
},
|
||||
{
|
||||
reg: '#chatgpt(迁移|恢复)(必应|Bing |bing )(token|Token)',
|
||||
reg: '^#chatgpt(迁移|恢复)(必应|Bing |bing )(token|Token)',
|
||||
fnc: 'migrateBingAccessToken',
|
||||
permission: 'master'
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue