From 024f825fbad3f0fea3bd4825b849952de2500ac0 Mon Sep 17 00:00:00 2001 From: Yasir Aris M Date: Thu, 14 Dec 2023 07:33:09 +0700 Subject: [PATCH] Revert force html, since from openai is mixed with markdown Signed-off-by: Yasir Aris M --- misskaty/plugins/chatbot_ai.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/misskaty/plugins/chatbot_ai.py b/misskaty/plugins/chatbot_ai.py index 9fb634cd..62d5ba4a 100644 --- a/misskaty/plugins/chatbot_ai.py +++ b/misskaty/plugins/chatbot_ai.py @@ -7,7 +7,7 @@ import html import random from openai import AsyncOpenAI, APIConnectionError, RateLimitError, APIStatusError -from pyrogram import filters, enums +from pyrogram import filters from pyrogram.errors import MessageTooLong from pyrogram.types import Message @@ -73,10 +73,10 @@ async def openai_chatbot(_, ctx: Message, strings): num += 1 answer += chunk.choices[0].delta.content if num == 30: - await msg.edit_msg(html.escape(answer), parse_mode=enums.ParseMode.HTML) + await msg.edit_msg(html.escape(answer)) await asyncio.sleep(1.5) num = 0 - await msg.edit_msg(html.escape(answer), parse_mode=enums.ParseMode.HTML) + await msg.edit_msg(html.escape(answer)) except MessageTooLong: answerlink = await post_to_telegraph( False, "MissKaty ChatBot ", html.escape(f"{answer}")