mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-08 04:44:51 +00:00
Revert force html, since from openai is mixed with markdown
Signed-off-by: Yasir Aris M <git@yasirdev.my.id>
This commit is contained in:
parent
593527f5a7
commit
024f825fba
1 changed files with 3 additions and 3 deletions
|
|
@ -7,7 +7,7 @@ import html
|
||||||
import random
|
import random
|
||||||
|
|
||||||
from openai import AsyncOpenAI, APIConnectionError, RateLimitError, APIStatusError
|
from openai import AsyncOpenAI, APIConnectionError, RateLimitError, APIStatusError
|
||||||
from pyrogram import filters, enums
|
from pyrogram import filters
|
||||||
from pyrogram.errors import MessageTooLong
|
from pyrogram.errors import MessageTooLong
|
||||||
from pyrogram.types import Message
|
from pyrogram.types import Message
|
||||||
|
|
||||||
|
|
@ -73,10 +73,10 @@ async def openai_chatbot(_, ctx: Message, strings):
|
||||||
num += 1
|
num += 1
|
||||||
answer += chunk.choices[0].delta.content
|
answer += chunk.choices[0].delta.content
|
||||||
if num == 30:
|
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)
|
await asyncio.sleep(1.5)
|
||||||
num = 0
|
num = 0
|
||||||
await msg.edit_msg(html.escape(answer), parse_mode=enums.ParseMode.HTML)
|
await msg.edit_msg(html.escape(answer))
|
||||||
except MessageTooLong:
|
except MessageTooLong:
|
||||||
answerlink = await post_to_telegraph(
|
answerlink = await post_to_telegraph(
|
||||||
False, "MissKaty ChatBot ", html.escape(f"<code>{answer}</code>")
|
False, "MissKaty ChatBot ", html.escape(f"<code>{answer}</code>")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue