Merge pull request 'refactor: don't close http session after command ran' (#3) from bananas/sox:main into main

Reviewed-on: https://codeberg.org/soteria/sox/pulls/3
This commit is contained in:
rainy 2024-08-24 22:57:14 +00:00
commit 05d80bc5ab
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()