From c1b295f47e0b796b04ad62ac7e20742e9cab613c Mon Sep 17 00:00:00 2001 From: Ananas Date: Fri, 23 Aug 2024 09:21:33 +0200 Subject: [PATCH] refactor: don't close http session after command ran --- plugins/soteria_plugin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/soteria_plugin.py b/plugins/soteria_plugin.py index a554cb5..fe3fcea 100644 --- a/plugins/soteria_plugin.py +++ b/plugins/soteria_plugin.py @@ -7,6 +7,10 @@ plugin = plugins.Plugin() sot = soteria.Client(cache=soteria.MemoryCache()) +@plugin.unload_hook() +async def close_sot(): + await sot.close() + @plugin.slash_command(description="gets the 5 most recent BANGERS (posts) from Soteria") async def get_posts(inter: disnake.CommandInteraction): await inter.response.defer() @@ -29,6 +33,5 @@ async def get_posts(inter: disnake.CommandInteraction): embed_list.append(embed) await inter.edit_original_response(embeds=embed_list) - await sot.close() setup, teardown = plugin.create_extension_handlers() \ No newline at end of file