From e435b0cbb9d33bdd3059bd00932d69cf0124728e Mon Sep 17 00:00:00 2001 From: Dustin Pianalto Date: Thu, 3 May 2018 12:59:45 -0800 Subject: [PATCH] Moved sending iss image into tpe --- exts/utils.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/exts/utils.py b/exts/utils.py index 0db7c1c..2efb04e 100644 --- a/exts/utils.py +++ b/exts/utils.py @@ -550,16 +550,12 @@ class Utils: img = BytesIO() plt.savefig(img, format='png', transparent=True) img.seek(0) - return img + self.bot.loop.create_task(ctx.send('Current ISS Location', file=discord.File(output, 'output.png'))) async with ctx.typing(): async with self.bot.aio_session.get('https://api.wheretheiss.at/v1/satellites/25544') as response: loc = await response.json() - msg = await ctx.send('Got location. Generating Image...') output = await self.bot.loop.run_in_executor(self.bot.tpe, gen_image, loc) - await msg.edit(content='Image Created. Uploading to Discord...') - await ctx.send('Current ISS Location', file=discord.File(output, 'output.png')) - await msg.delete() # TODO Create Help command