cherry-pick: 1

This commit is contained in:
ikechan8370 2024-03-10 17:27:41 +08:00
parent 8e73a28dae
commit fd2d976686
5 changed files with 69 additions and 15 deletions

View file

@ -72,7 +72,7 @@ import { solveCaptchaOneShot } from '../utils/bingCaptcha.js'
import { ClaudeAIClient } from '../utils/claude.ai/index.js'
import { getProxy } from '../utils/proxy.js'
import { QwenApi } from '../utils/alibaba/qwen-api.js'
import { getChatHistoryGroup } from '../utils/chat.js'
import { generateSuggestedResponse, getChatHistoryGroup } from '../utils/chat.js'
import { CustomGoogleGeminiClient } from '../client/CustomGoogleGeminiClient.js'
import { resizeAndCropImage } from '../utils/dalle.js'
import fs from 'fs'
@ -862,8 +862,8 @@ export class chatgpt extends plugin {
}
// 处理星火和bard图片
if ((use === 'bard' || use === 'xh') && chatMessage?.images) {
chatMessage.images.forEach(async element => {
await this.reply([element.tag, segment.image(element.url)])
chatMessage.images.forEach(element => {
this.reply([element.tag, segment.image(element.url)])
})
}
// chatglm4图片调整至sendMessage中处理
@ -1102,7 +1102,13 @@ export class chatgpt extends plugin {
if (quotemessage.length > 0) {
this.reply(await makeForwardMsg(this.e, quotemessage.map(msg => `${msg.text} - ${msg.url}`)))
}
if (chatMessage?.conversation && Config.enableSuggestedResponses && !chatMessage.suggestedResponses && Config.apiKey) {
try {
chatMessage.suggestedResponses = await generateSuggestedResponse(chatMessage.conversation)
} catch (err) {
logger.debug('生成建议回复失败', err)
}
}
this.reply(responseText, e.isGroup, {
btnData: {
use,
@ -1166,7 +1172,7 @@ export class chatgpt extends plugin {
}
async glm4 (e) {
return await this.otherMode(e, 'chatglm4')
return await this.otherMode(e, 'chatglm4', '#glm4')
}
async gemini (e) {
@ -2027,7 +2033,7 @@ export class chatgpt extends plugin {
tools.push(...[new EliMusicTool(), new EliMovieTool()])
} catch (err) {
tools.push(...[new SendMusicTool(), new SearchMusicTool()])
logger.mark(logger.green('【ChatGPT-Plugin】插件avocado-plugin未安装') + ',安装后可查看最近热映电影与体验可玩性更高的点歌工具。\n可前往 https://github.com/Qz-Sean/avocado-plugin 获取')
logger.debug(logger.green('【ChatGPT-Plugin】插件avocado-plugin未安装') + ',安装后可查看最近热映电影与体验可玩性更高的点歌工具。\n可前往 https://github.com/Qz-Sean/avocado-plugin 获取')
}
if (e.isGroup) {
let botInfo = await e.bot.getGroupMemberInfo(e.group_id, getUin(e), true)