From a21e2d9ef16a234596775ddb9acd4c108b1cd32f Mon Sep 17 00:00:00 2001 From: ikechan8370 Date: Thu, 23 Mar 2023 20:38:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8E=9F=E7=89=88bing?= =?UTF-8?q?=E7=BB=93=E6=9D=9F=E5=AF=B9=E8=AF=9D=E6=97=A0=E6=95=88=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/chat.js | 12 ++++++++++-- utils/config.js | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/apps/chat.js b/apps/chat.js index 9303b75..4298395 100644 --- a/apps/chat.js +++ b/apps/chat.js @@ -248,7 +248,7 @@ export class chatgpt extends plugin { if (!c) { await this.reply('当前没有开启对话', true) } else { - await redis.del(`CHATGPT:CONVERSATIONS:${e.sender.user_id}`) + await redis.del(`CHATGPT:CONVERSATIONS_BING:${e.sender.user_id}`) await this.reply('已结束当前对话,请@我进行聊天以开启新的对话', true) } } @@ -288,7 +288,7 @@ export class chatgpt extends plugin { logger.info(`ChatGLMUser_${e.sender.user_id}`, await conversationsCache.get(`ChatGLMUser_${e.sender.user_id}`)) await conversationsCache.delete(`ChatGLMUser_${qq}`) await this.reply('已退出当前对话,该对话仍然保留。请@我进行聊天以开启新的对话', true) - } else { + } else if (use === 'api') { let c = await redis.get(`CHATGPT:CONVERSATIONS:${qq}`) if (!c) { await this.reply(`当前${atUser}没有开启对话`, true) @@ -296,6 +296,14 @@ export class chatgpt extends plugin { await redis.del(`CHATGPT:CONVERSATIONS:${qq}`) await this.reply(`已结束${atUser}的对话,TA仍可以@我进行聊天以开启新的对话`, true) } + } else if (use === 'bing') { + let c = await redis.get(`CHATGPT:CONVERSATIONS_BING:${qq}`) + if (!c) { + await this.reply(`当前${atUser}没有开启对话`, true) + } else { + await redis.del(`CHATGPT:CONVERSATIONS_BING:${qq}`) + await this.reply(`已结束${atUser}的对话,TA仍可以@我进行聊天以开启新的对话`, true) + } } } } diff --git a/utils/config.js b/utils/config.js index 651ba7e..5eb1855 100644 --- a/utils/config.js +++ b/utils/config.js @@ -68,7 +68,7 @@ const defaultConfig = { helloPrompt: '写一段话让大家来找我聊天。类似于“有人找我聊天吗?"这种风格,轻松随意一点控制在20个字以内', chatglmBaseUrl: 'http://localhost:8080', allowOtherMode: true, - version: 'v2.3.0' + version: 'v2.3.1' } const _path = process.cwd() let config = {}