mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-08 12:54:51 +00:00
Gatau kenapa make httpx broken
This commit is contained in:
parent
1193e1877c
commit
6ef50936b6
1 changed files with 3 additions and 2 deletions
|
|
@ -6,9 +6,10 @@ import asyncio
|
||||||
import html
|
import html
|
||||||
import json
|
import json
|
||||||
import random
|
import random
|
||||||
|
import requests
|
||||||
|
|
||||||
from openai import APIConnectionError, APIStatusError, AsyncAzureOpenAI, RateLimitError
|
from openai import APIConnectionError, APIStatusError, AsyncAzureOpenAI, RateLimitError
|
||||||
from pyrogram import filters
|
from pyrogram import filters, utils
|
||||||
from pyrogram.errors import MessageTooLong
|
from pyrogram.errors import MessageTooLong
|
||||||
from pyrogram.types import Message
|
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:
|
if response.status_code != 200:
|
||||||
self.log.info(response.text)
|
self.log.info(response.text)
|
||||||
return await msg.edit_msg(f"ERROR: Status Code {response.status_code}")
|
return await msg.edit_msg(f"ERROR: Status Code {response.status_code}")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue