mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 13:27:08 +00:00
fix: 兼容性修复
This commit is contained in:
parent
4c737d5728
commit
59ab8df658
24 changed files with 70 additions and 349 deletions
|
|
@ -86,10 +86,10 @@ export async function makeForwardMsg (e, msg = [], dec = '') {
|
|||
if (Version.isTrss) {
|
||||
return common.makeForwardMsg(e, msg, dec)
|
||||
}
|
||||
let nickname = Bot.nickname
|
||||
let nickname = e.bot.nickname
|
||||
if (e.isGroup) {
|
||||
try {
|
||||
let info = await Bot.getGroupMemberInfo(e.group_id, getUin(e))
|
||||
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}`)
|
||||
|
|
@ -792,7 +792,7 @@ export async function getImageOcrText (e) {
|
|||
let resultArr = []
|
||||
let eachImgRes = ''
|
||||
for (let i in img) {
|
||||
const imgOCR = await Bot.imageOcr(img[i])
|
||||
const imgOCR = await e.bot.imageOcr(img[i])
|
||||
for (let text of imgOCR.wordslist) {
|
||||
eachImgRes += (`${text?.words} \n`)
|
||||
}
|
||||
|
|
@ -827,11 +827,11 @@ export function getMaxModelTokens (model = 'gpt-3.5-turbo') {
|
|||
}
|
||||
|
||||
export function getUin (e) {
|
||||
if (e?.bot?.uin) return e.bot.uin
|
||||
if (Array.isArray(Bot.uin)) {
|
||||
if (Config.trssBotUin && Bot.uin.indexOf(Config.trssBotUin) > -1) return Config.trssBotUin
|
||||
else return Bot.uin[0]
|
||||
} else return Bot.uin
|
||||
if (e?.bot?.uin) return e.e.bot.uin
|
||||
if (Array.isArray(e.bot.uin)) {
|
||||
if (Config.trssBotUin && e.bot.uin.indexOf(Config.trssBotUin) > -1) return Config.trssBotUin
|
||||
else return e.bot.uin[0]
|
||||
} else return e.bot.uin
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue