From f5f46878de63942e6bc025a56342f26812b0422e Mon Sep 17 00:00:00 2001 From: phixxy Date: Wed, 17 Jan 2024 22:51:26 -0800 Subject: [PATCH] closed aiohttp connections after use --- plugins/meme.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/meme.py b/plugins/meme.py index 4de4247..f43229d 100644 --- a/plugins/meme.py +++ b/plugins/meme.py @@ -24,6 +24,7 @@ async def answer_question(topic, model="gpt-3.5-turbo"): # Only needed for draw async with http_session.post(url, headers=headers, json=data) as resp: response_data = await resp.json() response = response_data['choices'][0]['message']['content'] + aiohttp.close() return response except Exception as error: @@ -105,6 +106,7 @@ async def meme(ctx): except Exception as error: await handle_error(error) print("Something's Wrong with the urllib So try again") + aiohttp.close() return image_link, filename try: