From d017323c256021a150b71042e3218c594aabe017 Mon Sep 17 00:00:00 2001 From: hibobmaster <32976627+hibobmaster@users.noreply.github.com> Date: Mon, 18 Sep 2023 13:56:07 +0800 Subject: [PATCH] Fix --- CHANGELOG.md | 1 + src/bot.py | 15 +++------------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d66b2ed..cf0eaef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - remove pandora - refactor chat and image genderation backend - reply in thread by default +- introduce pre-commit hooks ## v1.0.4 diff --git a/src/bot.py b/src/bot.py index dcfcbef..19e4dee 100644 --- a/src/bot.py +++ b/src/bot.py @@ -121,7 +121,7 @@ class Bot: # close session async def close(self, task: asyncio.Task) -> None: - await self.session.aclose() + await self.httpx_client.aclose() self.driver.disconnect() task.cancel() @@ -206,6 +206,7 @@ class Bot: channel_id, "New conversation created, " + "please use !chat to start chatting!", + root_id, ) except Exception as e: logger.error(e, exc_info=True) @@ -274,22 +275,12 @@ class Bot: logger.error(e, exc_info=True) raise Exception(e) - # !gpt command function - async def gpt(self, prompt: str) -> str: - return await self.askgpt.oneTimeAsk(prompt) - - # !chat command function - async def chat(self, prompt: str) -> str: - return await self.gptchatbot.ask_async(prompt) - # !help command function def help(self) -> str: help_info = ( "!gpt [content], generate response without context conversation\n" + "!chat [content], chat with context conversation\n" - + "!pic [prompt], Image generation by Microsoft Bing\n" - + "!talk [content], talk using chatgpt web\n" - + "!goon, continue the incomplete conversation\n" + + "!pic [prompt], Image generation with DALLĀ·E or LocalAI or stable-diffusion-webui\n" # noqa: E501 + "!new, start a new conversation\n" + "!help, help message" )