From 2bf92e2bbf71017f7437327a34699ae52c4c2be4 Mon Sep 17 00:00:00 2001 From: ikechan8370 Date: Sat, 24 Jun 2023 23:38:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=80=E4=BA=9B=E6=9E=81=E7=AB=AF?= =?UTF-8?q?=E7=9A=84=E6=8E=AA=E6=96=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/chat.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/apps/chat.js b/apps/chat.js index 38fa4c3..89adb0d 100644 --- a/apps/chat.js +++ b/apps/chat.js @@ -58,9 +58,9 @@ import { WebsiteTool } from '../utils/tools/WebsiteTool.js' import { WeatherTool } from '../utils/tools/WeatherTool.js' import { SerpTool } from '../utils/tools/SerpTool.js' import { SerpIkechan8370Tool } from '../utils/tools/SerpIkechan8370Tool.js' -import {SendPictureTool} from "../utils/tools/SendPictureTool.js"; -import {SerpImageTool} from "../utils/tools/SearchImageTool.js"; -import {ImageCaptionTool} from "../utils/tools/ImageCaptionTool.js"; +import { SendPictureTool } from '../utils/tools/SendPictureTool.js' +import { SerpImageTool } from '../utils/tools/SearchImageTool.js' +import { ImageCaptionTool } from '../utils/tools/ImageCaptionTool.js' try { await import('emoji-strip') } catch (err) { @@ -1954,10 +1954,7 @@ export class chatgpt extends plugin { } let tools = [ - new SearchVideoTool(), - new SendVideoTool(), - new SearchMusicTool(), - new SendMusicTool(), + // new SendAvatarTool(), // new SendDiceTool(), new EditCardTool(), @@ -1967,7 +1964,7 @@ export class chatgpt extends plugin { new KickOutTool(), new WeatherTool(), new SendPictureTool(), - new SerpImageTool(), + new ImageCaptionTool(), serpTool ] @@ -1994,6 +1991,12 @@ export class chatgpt extends plugin { } if (img.length > 0) { prompt += `\nthe url of the picture(s) above: ${img.join(', ')}` + } else { + tools.push(new SerpImageTool()) + tools.push(...[new SearchVideoTool(), + new SendVideoTool(), + new SearchMusicTool(), + new SendMusicTool()]) } // if (e.sender.role === 'admin' || e.sender.role === 'owner') { // tools.push(...[new JinyanTool(), new KickOutTool()])