From 0256ecc517be560bc6adc1150d005f3c3db2967f Mon Sep 17 00:00:00 2001 From: Yasir Aris M Date: Fri, 9 Aug 2024 10:43:53 +0700 Subject: [PATCH] Add exception --- misskaty/plugins/chatbot_ai.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/misskaty/plugins/chatbot_ai.py b/misskaty/plugins/chatbot_ai.py index 4ffb7e3a..8e8a1bb4 100644 --- a/misskaty/plugins/chatbot_ai.py +++ b/misskaty/plugins/chatbot_ai.py @@ -93,6 +93,8 @@ async def gpt4_chatbot(self, ctx: Message, strings): ] } response = await fetch.post("https://duckduckgo.com/duckchat/v1/chat", headers=headers, json=data) + if response.status_code != 200: + return await msg.edit_msg(f"ERROR: Status Code {response.status_code}") messages = [] for line in response.text.splitlines(): if line.startswith('data:'):