Add map location
This commit is contained in:
parent
d55b889a3a
commit
c7e0fe017c
@ -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,6 +608,7 @@ 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.')
|
||||
async with ctx.typing():
|
||||
await self.bot.loop.run_in_executor(self.bot.tpe, gen_image, location_data)
|
||||
await msg.delete()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user