mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 13:27:08 +00:00
fix: 修复TRSS转发错误,chronocat linux应该还没适配
This commit is contained in:
parent
95e730f250
commit
4066f17847
2 changed files with 41 additions and 34 deletions
|
|
@ -768,6 +768,7 @@ export class chatgpt extends plugin {
|
|||
}
|
||||
if (e.user_id == getUin(e)) return false
|
||||
prompt = msg.trim()
|
||||
try {
|
||||
if (e.isGroup && typeof this.e.group.getMemberMap === 'function') {
|
||||
let mm = await this.e.group.getMemberMap()
|
||||
let me = mm.get(getUin(e)) || {}
|
||||
|
|
@ -797,6 +798,9 @@ export class chatgpt extends plugin {
|
|||
prompt = prompt.replace(`@${card}`, '').trim()
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
logger.warn(err)
|
||||
}
|
||||
} else {
|
||||
let ats = e.message.filter(m => m.type === 'at')
|
||||
if (!(e.atme || e.atBot) && ats.length > 0) {
|
||||
|
|
|
|||
|
|
@ -1,18 +1,20 @@
|
|||
// import { remark } from 'remark'
|
||||
// import stripMarkdown from 'strip-markdown'
|
||||
import {exec} from 'child_process'
|
||||
import { exec } from 'child_process'
|
||||
import lodash from 'lodash'
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
import buffer from 'buffer'
|
||||
import yaml from 'yaml'
|
||||
import puppeteer from '../../../lib/puppeteer/puppeteer.js'
|
||||
import {Config} from './config.js'
|
||||
import {convertSpeaker, generateVitsAudio, speakers as vitsRoleList} from './tts.js'
|
||||
import VoiceVoxTTS, {supportConfigurations as voxRoleList} from './tts/voicevox.js'
|
||||
import AzureTTS, {supportConfigurations as azureRoleList} from './tts/microsoft-azure.js'
|
||||
import {translate} from './translate.js'
|
||||
import common from '../../../lib/common/common.js'
|
||||
import { Config } from './config.js'
|
||||
import { convertSpeaker, generateVitsAudio, speakers as vitsRoleList } from './tts.js'
|
||||
import VoiceVoxTTS, { supportConfigurations as voxRoleList } from './tts/voicevox.js'
|
||||
import AzureTTS, { supportConfigurations as azureRoleList } from './tts/microsoft-azure.js'
|
||||
import { translate } from './translate.js'
|
||||
import uploadRecord from './uploadRecord.js'
|
||||
import Version from './version.js'
|
||||
// export function markdownToText (markdown) {
|
||||
// return remark()
|
||||
// .use(stripMarkdown)
|
||||
|
|
@ -81,6 +83,9 @@ export async function tryTimes (promiseFn, maxTries = 10) {
|
|||
}
|
||||
|
||||
export async function makeForwardMsg (e, msg = [], dec = '') {
|
||||
if (Version.isTrss) {
|
||||
return common.makeForwardMsg(e, msg, dec)
|
||||
}
|
||||
let nickname = Bot.nickname
|
||||
if (e.isGroup) {
|
||||
try {
|
||||
|
|
@ -919,7 +924,6 @@ export async function generateAzureAudio (pendingText, role = '随机', speaking
|
|||
let languagePrefix = azureRoleList.find(config => config.code === speaker).languageDetail.charAt(0)
|
||||
languagePrefix = languagePrefix.startsWith('E') ? '英' : languagePrefix
|
||||
pendingText = (await translate(pendingText, languagePrefix)).replace('\n', '')
|
||||
|
||||
} else {
|
||||
let role, languagePrefix
|
||||
role = azureRoleList[Math.floor(Math.random() * azureRoleList.length)]
|
||||
|
|
@ -961,4 +965,3 @@ export function getUserSpeaker (userSetting) {
|
|||
return userSetting.ttsRoleVoiceVox || Config.voicevoxTTSSpeaker
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue