From aee64ce2357d3d54a6b4847c18e375d54011b9f9 Mon Sep 17 00:00:00 2001 From: 0x5c Date: Sat, 7 Dec 2019 13:26:49 -0500 Subject: [PATCH] Fixed wttr embeds for unicode locations Fixes #90 --- cogs/weathercog.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/cogs/weathercog.py b/cogs/weathercog.py index 5c1faab..4be5317 100644 --- a/cogs/weathercog.py +++ b/cogs/weathercog.py @@ -90,13 +90,10 @@ See help for weather command for possible location types. Add a `-c` or `-f` to embed.colour = cmn.colours.bad else: data = io.BytesIO(await resp.read()) - loc = loc.replace('+', '') - loc = loc.replace('@', '') - loc = loc.replace('~', '') - embed.set_image(url=f'attachment://{loc}_{units}pnFQ.png') + embed.set_image(url=f'attachment://wttr_forecast.png') embed.set_footer(text=ctx.author.name, icon_url=str(ctx.author.avatar_url)) - await ctx.send(embed=embed, file=discord.File(data, f'{loc}_{units}pnFQ.png')) + await ctx.send(embed=embed, file=discord.File(data, f'wttr_forecast.png')) @_weather_conditions.command(name='now', aliases=['n'], category=cmn.cat.weather) async def _weather_conditions_now(self, ctx: commands.Context, *, location: str): @@ -128,13 +125,10 @@ See help for weather command for possible location types. Add a `-c` or `-f` to embed.colour = cmn.colours.bad else: data = io.BytesIO(await resp.read()) - loc = loc.replace('+', '') - loc = loc.replace('@', '') - loc = loc.replace('~', '') - embed.set_image(url=f'attachment://{loc}_0{units}pnFQ.png') + embed.set_image(url=f'attachment://wttr_now.png') embed.set_footer(text=ctx.author.name, icon_url=str(ctx.author.avatar_url)) - await ctx.send(embed=embed, file=discord.File(data, f'{loc}_0{units}pnFQ.png')) + await ctx.send(embed=embed, file=discord.File(data, 'wttr_now.png')) def setup(bot: commands.Bot):