fixed self.bot.http_session which no longer exists
This commit is contained in:
parent
6808abd274
commit
8dd2ce0cdb
1 changed files with 2 additions and 2 deletions
|
|
@ -106,7 +106,7 @@ class PhixxyCom(commands.Cog):
|
||||||
for i in r['images']:
|
for i in r['images']:
|
||||||
image = Image.open(io.BytesIO(base64.b64decode(i.split(",", 1)[0])))
|
image = Image.open(io.BytesIO(base64.b64decode(i.split(",", 1)[0])))
|
||||||
png_payload = {"image": "data:image/png;base64," + i}
|
png_payload = {"image": "data:image/png;base64," + i}
|
||||||
response2 = await self.bot.http_session.post(url=f'{url}/sdapi/v1/png-info', json=png_payload)
|
response2 = await self.http_session.post(url=f'{url}/sdapi/v1/png-info', json=png_payload)
|
||||||
pnginfo = PngImagePlugin.PngInfo()
|
pnginfo = PngImagePlugin.PngInfo()
|
||||||
json_response = await response2.json()
|
json_response = await response2.json()
|
||||||
pnginfo.add_text("parameters", json_response.get("info"))
|
pnginfo.add_text("parameters", json_response.get("info"))
|
||||||
|
|
@ -206,7 +206,7 @@ class PhixxyCom(commands.Cog):
|
||||||
url = "https://api.openai.com/v1/chat/completions"
|
url = "https://api.openai.com/v1/chat/completions"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
async with self.bot.http_session.post(url, headers=headers, json=data) as resp:
|
async with self.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']
|
||||||
return response
|
return response
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue