Skip to content

Commit

Permalink
Gatau kenapa make httpx broken
Browse files Browse the repository at this point in the history
  • Loading branch information
yasirarism committed Aug 10, 2024
1 parent 1193e18 commit 6ef5093
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions misskaty/plugins/chatbot_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
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

Expand Down Expand Up @@ -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}")
Expand Down

0 comments on commit 6ef5093

Please sign in to comment.