From 51f695ac867489439c4332606c66a5926ad9c8c5 Mon Sep 17 00:00:00 2001 From: Yasir Aris M Date: Sun, 11 Feb 2024 21:50:16 +0700 Subject: [PATCH] Update chatbot_ai.py Signed-off-by: Yasir Aris M --- misskaty/plugins/chatbot_ai.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misskaty/plugins/chatbot_ai.py b/misskaty/plugins/chatbot_ai.py index da17aa5f..7c0ae9b2 100644 --- a/misskaty/plugins/chatbot_ai.py +++ b/misskaty/plugins/chatbot_ai.py @@ -105,10 +105,10 @@ async def openai_chatbot(_, ctx: Message, strings): strings("answers_too_long").format(answerlink=answerlink), disable_web_page_preview=True, ) - except APIConnectionError as str(e): + except APIConnectionError as e: await msg.edit_msg(f"The server could not be reached because {e.__cause__}") except RateLimitError as e: - if "billing details" in e: + if "billing details" in str(e): return await msg.edit_msg("This openai key from this bot has expired, please give openai key donation for bot owner.") await msg.edit_msg("You're got rate limit, please try again later.") except APIStatusError as e: