mirror of https://codeberg.org/soteria/sox.git
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:
commit
05d80bc5ab
|
|
@ -7,6 +7,10 @@ plugin = plugins.Plugin()
|
||||||
|
|
||||||
sot = soteria.Client(cache=soteria.MemoryCache())
|
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")
|
@plugin.slash_command(description="gets the 5 most recent BANGERS (posts) from Soteria")
|
||||||
async def get_posts(inter: disnake.CommandInteraction):
|
async def get_posts(inter: disnake.CommandInteraction):
|
||||||
await inter.response.defer()
|
await inter.response.defer()
|
||||||
|
|
@ -29,6 +33,5 @@ async def get_posts(inter: disnake.CommandInteraction):
|
||||||
embed_list.append(embed)
|
embed_list.append(embed)
|
||||||
|
|
||||||
await inter.edit_original_response(embeds=embed_list)
|
await inter.edit_original_response(embeds=embed_list)
|
||||||
await sot.close()
|
|
||||||
|
|
||||||
setup, teardown = plugin.create_extension_handlers()
|
setup, teardown = plugin.create_extension_handlers()
|
||||||
Loading…
Reference in New Issue