From c7e0fe017c058fa1c799c3b65794b9630492ccb6 Mon Sep 17 00:00:00 2001 From: Dustin Pianalto Date: Fri, 4 May 2018 10:39:15 -0800 Subject: [PATCH] Add map location --- exts/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/exts/utils.py b/exts/utils.py index 716d8c1..9da8468 100644 --- a/exts/utils.py +++ b/exts/utils.py @@ -599,6 +599,7 @@ class Utils: plt.savefig(img, format='png', transparent=True) img.seek(0) self.bot.loop.create_task(ctx.send(file=discord.File(img, f'{location} map.png'))) + self.bot.loop.create_task(ctx.trigger_typing()) msg = await ctx.send(f'Checking on location data for {location.title()}') async with ctx.typing(): @@ -607,7 +608,8 @@ class Utils: data = await result.json() location_data = data['results'][0]['geometry'] await msg.edit(content=f'Got Location. Please wait, Generating the image can take up to a minute.') - await self.bot.loop.run_in_executor(self.bot.tpe, gen_image, location_data) + async with ctx.typing(): + await self.bot.loop.run_in_executor(self.bot.tpe, gen_image, location_data) await msg.delete() # TODO Create Help command