fix: remove strange makeforward

This commit is contained in:
ikechan8370 2024-03-14 14:45:28 +08:00
parent 36f0dbd94f
commit a539b26e8e
2 changed files with 50 additions and 88 deletions

View file

@ -383,6 +383,7 @@ export default class SydneyAIClient {
// 'cricinfo',
// 'cricinfov2',
'dv3sugg',
'autosave',
// 'gencontentv3',
'iycapbing',
'iyxapbing',
@ -391,12 +392,21 @@ export default class SydneyAIClient {
// 'revimgsrc1',
// 'revimgur',
// 'clgalileo',
'eredirecturl',
// 'eredirecturl',
// copilot
'uquopt',
'papynoapi',
'gndlogcf',
'sapsgrd'
// 'botthrottle',
// 'dlimitationnc',
// 'hourthrot',
// 'gndlogcf',
// 'ciorigimage',
// 'codeintfile',
'eredirecturl',
// 'ldsummary',
// 'ldqa',
// 'sdretrieval',
// "gencontentv3",
// 'gpt4tmncnp'
]
if (!isCreative) {
optionsSets.push('clgalileo')
@ -457,28 +467,30 @@ export default class SydneyAIClient {
'GeneratedCode'
],
sliceIds: [
'sappbcbt',
'inlineadsv2ho-prod',
'bgstream',
'dlidlat',
'autotts',
'dlid',
'sydoroff',
'voicemap',
'72enasright',
'semseronomon',
'srchqryfix',
'cmcpupsalltf',
'proupsallcf',
'206mems0',
'0209bicv3',
'205dcl1bt15',
'etlog',
'fpallsticy',
'0208papynoa',
'sapsgrd',
'1pgptwdes',
'newzigpt'
// 'supllmnfe',
// 'nodescf',
// 'stcheckcf',
// 'invldrqcf',
// 'v6voice',
// 'vnextr100',
// 'sydvrate100',
// 'vnextvoice',
// 'scmcbasecf',
// 'cmcpupsalltf',
// 'sydtransjson',
// 'thdnsrchcf',
// '220dcl1bt15',
// '311dlicnc',
// '0215wcrwippsr',
// '0305hrthrot',
// '0130gpt4t',
// 'bingfccf',
// 'dissagrds0',
// '0228scs',
// 'scprompt1',
// '228pyfilenfb',
// 'ecipc',
// '3022tpvs0'
],
requestId: crypto.randomUUID(),
traceId: genRanHex(32),
@ -536,11 +548,17 @@ export default class SydneyAIClient {
spokenTextMode: 'None',
conversationId,
previousMessages,
plugins: [
// {
// id: 'c310c353-b9f0-4d76-ab0d-1dd5e979cf68'
// }
]
// plugins: [
// {
// id: 'c310c353-b9f0-4d76-ab0d-1dd5e979cf68',
// category: 1
// }
// ],
// extraExtensionParameters: {
// 'gpt-creator-persona': {
// personaId: 'copilot'
// }
// }
}
if (encryptedconversationsignature) {

View file

@ -87,63 +87,7 @@ 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 = e.bot.nickname
if (e.isGroup) {
try {
let info = await e.bot.getGroupMemberInfo(e.group_id, getUin(e))
nickname = info.card || info.nickname
} catch (err) {
console.error(`Failed to get group member info: ${err}`)
}
}
let userInfo = {
user_id: getUin(e),
nickname
}
let forwardMsg = []
msg.forEach((v) => {
forwardMsg.push({
...userInfo,
message: v
})
})
let is_sign = true
/** 制作转发内容 */
if (e.isGroup) {
forwardMsg = await e.group.makeForwardMsg(forwardMsg)
} else if (e.friend) {
forwardMsg = await e.friend.makeForwardMsg(forwardMsg)
} else {
return msg.join('\n')
}
let forwardMsg_json = forwardMsg.data
if (typeof (forwardMsg_json) === 'object') {
if (forwardMsg_json.app === 'com.tencent.multimsg' && forwardMsg_json.meta?.detail) {
let detail = forwardMsg_json.meta.detail
let resid = detail.resid
let fileName = detail.uniseq
let preview = ''
for (let val of detail.news) {
preview += `<title color="#777777" size="26">${val.text}</title>`
}
forwardMsg.data = `<?xml version="1.0" encoding="utf-8"?><msg brief="[聊天记录]" m_fileName="${fileName}" action="viewMultiMsg" tSum="1" flag="3" m_resid="${resid}" serviceID="35" m_fileSize="0"><item layout="1"><title color="#000000" size="34">转发的聊天记录</title>${preview}<hr></hr><summary color="#808080" size="26">${detail.summary}</summary></item><source name="聊天记录"></source></msg>`
forwardMsg.type = 'xml'
forwardMsg.id = 35
}
}
forwardMsg.data = forwardMsg.data
.replace(/\n/g, '')
.replace(/<title color="#777777" size="26">(.+?)<\/title>/g, '___')
.replace(/___+/, `<title color="#777777" size="26">${dec}</title>`)
if (!is_sign) {
forwardMsg.data = forwardMsg.data
.replace('转发的', '不可转发的')
}
return forwardMsg
return common.makeForwardMsg(e, msg, dec)
}
// @see https://github.com/sindresorhus/p-timeout