mirror of
https://github.com/miaowware/qrm2.git
synced 2024-11-23 00:08:38 -05:00
Merge pull request #92 from classabbyamp/5c-wttrfix
Fixed wttr embeds for unicode locations
This commit is contained in:
commit
18bfdb0542
@ -90,13 +90,10 @@ See help for weather command for possible location types. Add a `-c` or `-f` to
|
|||||||
embed.colour = cmn.colours.bad
|
embed.colour = cmn.colours.bad
|
||||||
else:
|
else:
|
||||||
data = io.BytesIO(await resp.read())
|
data = io.BytesIO(await resp.read())
|
||||||
loc = loc.replace('+', '')
|
embed.set_image(url=f'attachment://wttr_forecast.png')
|
||||||
loc = loc.replace('@', '')
|
|
||||||
loc = loc.replace('~', '')
|
|
||||||
embed.set_image(url=f'attachment://{loc}_{units}pnFQ.png')
|
|
||||||
embed.set_footer(text=ctx.author.name,
|
embed.set_footer(text=ctx.author.name,
|
||||||
icon_url=str(ctx.author.avatar_url))
|
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)
|
@_weather_conditions.command(name='now', aliases=['n'], category=cmn.cat.weather)
|
||||||
async def _weather_conditions_now(self, ctx: commands.Context, *, location: str):
|
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
|
embed.colour = cmn.colours.bad
|
||||||
else:
|
else:
|
||||||
data = io.BytesIO(await resp.read())
|
data = io.BytesIO(await resp.read())
|
||||||
loc = loc.replace('+', '')
|
embed.set_image(url=f'attachment://wttr_now.png')
|
||||||
loc = loc.replace('@', '')
|
|
||||||
loc = loc.replace('~', '')
|
|
||||||
embed.set_image(url=f'attachment://{loc}_0{units}pnFQ.png')
|
|
||||||
embed.set_footer(text=ctx.author.name,
|
embed.set_footer(text=ctx.author.name,
|
||||||
icon_url=str(ctx.author.avatar_url))
|
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):
|
def setup(bot: commands.Bot):
|
||||||
|
Loading…
Reference in New Issue
Block a user