Added display typing while generating image for iss

release-1.0.0
DustyP 8 years ago
parent e62e2c252f
commit bfe7f5835d

@ -536,6 +536,7 @@ class Utils:
@commands.command(name='iss') @commands.command(name='iss')
async def iss_loc(self, ctx): async def iss_loc(self, ctx):
async with ctx.typing():
async with self.bot.aio_session.get('https://api.wheretheiss.at/v1/satellites/25544') as response: async with self.bot.aio_session.get('https://api.wheretheiss.at/v1/satellites/25544') as response:
iss_loc = await response.json() iss_loc = await response.json()
@ -549,7 +550,6 @@ class Utils:
plt.text(x, y, ' ISS', fontsize=20, color='red') plt.text(x, y, ' ISS', fontsize=20, color='red')
with BytesIO() as output: with BytesIO() as output:
async with ctx.typing():
plt.savefig(output, format='png', transparent=True) plt.savefig(output, format='png', transparent=True)
output.seek(0) output.seek(0)
await ctx.send(file=discord.File(output, 'output.png')) await ctx.send(file=discord.File(output, 'output.png'))

Loading…
Cancel
Save