refactor: don't close http session after command ran

This commit is contained in:
Ananas 2024-08-23 09:21:33 +02:00
parent c0e1dfff66
commit c1b295f47e
No known key found for this signature in database
GPG Key ID: CAE30FFA43F0F76F
1 changed files with 4 additions and 1 deletions

View File

@ -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()