From 6ef50936b6aecaaed38e0648299a47aa8411c373 Mon Sep 17 00:00:00 2001 From: Yasir Aris M Date: Sat, 10 Aug 2024 20:41:13 +0700 Subject: [PATCH] Gatau kenapa make httpx broken --- misskaty/plugins/chatbot_ai.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/misskaty/plugins/chatbot_ai.py b/misskaty/plugins/chatbot_ai.py index 0fb66edf..86e1c59c 100644 --- a/misskaty/plugins/chatbot_ai.py +++ b/misskaty/plugins/chatbot_ai.py @@ -6,9 +6,10 @@ import asyncio import html import json import random +import requests from openai import APIConnectionError, APIStatusError, AsyncAzureOpenAI, RateLimitError -from pyrogram import filters +from pyrogram import filters, utils from pyrogram.errors import MessageTooLong from pyrogram.types import Message @@ -101,7 +102,7 @@ async def gpt4_chatbot(self, ctx: Message, strings): } ] } - response = await fetch.post("https://duckduckgo.com/duckchat/v1/chat", headers=headers, json=data) + response = await utils.run_sync(requests.post, "https://duckduckgo.com/duckchat/v1/chat", headers=headers, json=data) if response.status_code != 200: self.log.info(response.text) return await msg.edit_msg(f"ERROR: Status Code {response.status_code}")