mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 05:47:11 +00:00
fix: remove strange makeforward
This commit is contained in:
parent
36f0dbd94f
commit
a539b26e8e
2 changed files with 50 additions and 88 deletions
|
|
@ -383,6 +383,7 @@ export default class SydneyAIClient {
|
||||||
// 'cricinfo',
|
// 'cricinfo',
|
||||||
// 'cricinfov2',
|
// 'cricinfov2',
|
||||||
'dv3sugg',
|
'dv3sugg',
|
||||||
|
'autosave',
|
||||||
// 'gencontentv3',
|
// 'gencontentv3',
|
||||||
'iycapbing',
|
'iycapbing',
|
||||||
'iyxapbing',
|
'iyxapbing',
|
||||||
|
|
@ -391,12 +392,21 @@ export default class SydneyAIClient {
|
||||||
// 'revimgsrc1',
|
// 'revimgsrc1',
|
||||||
// 'revimgur',
|
// 'revimgur',
|
||||||
// 'clgalileo',
|
// 'clgalileo',
|
||||||
'eredirecturl',
|
// 'eredirecturl',
|
||||||
// copilot
|
// copilot
|
||||||
'uquopt',
|
'uquopt',
|
||||||
'papynoapi',
|
// 'botthrottle',
|
||||||
'gndlogcf',
|
// 'dlimitationnc',
|
||||||
'sapsgrd'
|
// 'hourthrot',
|
||||||
|
// 'gndlogcf',
|
||||||
|
// 'ciorigimage',
|
||||||
|
// 'codeintfile',
|
||||||
|
'eredirecturl',
|
||||||
|
// 'ldsummary',
|
||||||
|
// 'ldqa',
|
||||||
|
// 'sdretrieval',
|
||||||
|
// "gencontentv3",
|
||||||
|
// 'gpt4tmncnp'
|
||||||
]
|
]
|
||||||
if (!isCreative) {
|
if (!isCreative) {
|
||||||
optionsSets.push('clgalileo')
|
optionsSets.push('clgalileo')
|
||||||
|
|
@ -457,28 +467,30 @@ export default class SydneyAIClient {
|
||||||
'GeneratedCode'
|
'GeneratedCode'
|
||||||
],
|
],
|
||||||
sliceIds: [
|
sliceIds: [
|
||||||
'sappbcbt',
|
// 'supllmnfe',
|
||||||
'inlineadsv2ho-prod',
|
// 'nodescf',
|
||||||
'bgstream',
|
// 'stcheckcf',
|
||||||
'dlidlat',
|
// 'invldrqcf',
|
||||||
'autotts',
|
// 'v6voice',
|
||||||
'dlid',
|
// 'vnextr100',
|
||||||
'sydoroff',
|
// 'sydvrate100',
|
||||||
'voicemap',
|
// 'vnextvoice',
|
||||||
'72enasright',
|
// 'scmcbasecf',
|
||||||
'semseronomon',
|
// 'cmcpupsalltf',
|
||||||
'srchqryfix',
|
// 'sydtransjson',
|
||||||
'cmcpupsalltf',
|
// 'thdnsrchcf',
|
||||||
'proupsallcf',
|
// '220dcl1bt15',
|
||||||
'206mems0',
|
// '311dlicnc',
|
||||||
'0209bicv3',
|
// '0215wcrwippsr',
|
||||||
'205dcl1bt15',
|
// '0305hrthrot',
|
||||||
'etlog',
|
// '0130gpt4t',
|
||||||
'fpallsticy',
|
// 'bingfccf',
|
||||||
'0208papynoa',
|
// 'dissagrds0',
|
||||||
'sapsgrd',
|
// '0228scs',
|
||||||
'1pgptwdes',
|
// 'scprompt1',
|
||||||
'newzigpt'
|
// '228pyfilenfb',
|
||||||
|
// 'ecipc',
|
||||||
|
// '3022tpvs0'
|
||||||
],
|
],
|
||||||
requestId: crypto.randomUUID(),
|
requestId: crypto.randomUUID(),
|
||||||
traceId: genRanHex(32),
|
traceId: genRanHex(32),
|
||||||
|
|
@ -536,11 +548,17 @@ export default class SydneyAIClient {
|
||||||
spokenTextMode: 'None',
|
spokenTextMode: 'None',
|
||||||
conversationId,
|
conversationId,
|
||||||
previousMessages,
|
previousMessages,
|
||||||
plugins: [
|
// plugins: [
|
||||||
// {
|
// {
|
||||||
// id: 'c310c353-b9f0-4d76-ab0d-1dd5e979cf68'
|
// id: 'c310c353-b9f0-4d76-ab0d-1dd5e979cf68',
|
||||||
// }
|
// category: 1
|
||||||
]
|
// }
|
||||||
|
// ],
|
||||||
|
// extraExtensionParameters: {
|
||||||
|
// 'gpt-creator-persona': {
|
||||||
|
// personaId: 'copilot'
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (encryptedconversationsignature) {
|
if (encryptedconversationsignature) {
|
||||||
|
|
|
||||||
|
|
@ -87,63 +87,7 @@ export async function tryTimes (promiseFn, maxTries = 10) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function makeForwardMsg (e, msg = [], dec = '') {
|
export async function makeForwardMsg (e, msg = [], dec = '') {
|
||||||
if (Version.isTrss) {
|
return common.makeForwardMsg(e, msg, dec)
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// @see https://github.com/sindresorhus/p-timeout
|
// @see https://github.com/sindresorhus/p-timeout
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue