removed handle_error
This commit is contained in:
parent
38009ae56e
commit
168481f96a
1 changed files with 3 additions and 4 deletions
|
|
@ -177,15 +177,14 @@ class PhixxyCom(commands.Cog):
|
||||||
url = "https://api.openai.com/v1/chat/completions"
|
url = "https://api.openai.com/v1/chat/completions"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
http_session = aiohttp.ClientSession()
|
async with self.bot.http_session.post(url, headers=headers, json=data) as resp:
|
||||||
async with http_session.post(url, headers=headers, json=data) as resp:
|
|
||||||
response_data = await resp.json()
|
response_data = await resp.json()
|
||||||
response = response_data['choices'][0]['message']['content']
|
response = response_data['choices'][0]['message']['content']
|
||||||
await http_session.close()
|
|
||||||
return response
|
return response
|
||||||
|
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
return await self.handle_error(error)
|
return None
|
||||||
|
#return await self.handle_error(error)
|
||||||
|
|
||||||
@commands.command()
|
@commands.command()
|
||||||
async def generate_blog(self, ctx):
|
async def generate_blog(self, ctx):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue