From e070bca202029e967e80fb5fe1b2240cf5ca3e5f Mon Sep 17 00:00:00 2001 From: Yasir Aris M Date: Mon, 15 Jan 2024 06:50:58 +0700 Subject: [PATCH] Fix 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 e78c8e79..a41c0e08 100644 --- a/misskaty/plugins/chatbot_ai.py +++ b/misskaty/plugins/chatbot_ai.py @@ -55,8 +55,8 @@ async def gemini_chatbot(_, ctx: Message, strings): json=json_data, timeout=20.0, ) - if response.json().get("promptFeedback"): - return await msg.edit_msg("⚠️ Sorry, the prompt you sent contains a forbidden word that is not permitted by AI.") + if response.json().get("candidates"): + return await msg.edit_msg("⚠️ Sorry, the prompt you sent maybe contains a forbidden word that is not permitted by AI.") await msg.edit_msg(html.escape(response.json()["candidates"][0]["content"]["parts"][0]["text"])) except Exception as e: await msg.edit_msg(str(e))