From 6092252eaa413ca12e3bf05c90298a4744f332f8 Mon Sep 17 00:00:00 2001 From: 0x5c Date: Sun, 17 Jan 2021 23:55:23 -0500 Subject: [PATCH] Renamed ?cond to ?solar - Deprecated old name and aliases. Fixes #324 --- CHANGELOG.md | 2 ++ exts/weather.py | 12 ++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37b3f1f..d5c680e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,8 +11,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - New colour theme for `?greyline`. - Moved great circle distance and bearing calculation from `?ungrid` to `?griddistance`. - `?ungrid` to `?latlong`. +- Renamed `?cond` to `?solar`. ### Deprecated - `?ungrid`. +- Deprecated old `?solar` aliases (`?cond`, etc). ## [2.5.1] - 2020-12-10 diff --git a/exts/weather.py b/exts/weather.py index 27dfdf6..78156cc 100644 --- a/exts/weather.py +++ b/exts/weather.py @@ -24,11 +24,15 @@ class WeatherCog(commands.Cog): self.bot = bot self.session = aiohttp.ClientSession(connector=bot.qrm.connector) - @commands.command(name="bandconditions", aliases=["cond", "condx", "conditions"], category=cmn.cat.weather) - async def _band_conditions(self, ctx: commands.Context): - """Gets a solar conditions report.""" + @commands.command(aliases=["solar", "bandconditions", "cond", "condx", "conditions"], category=cmn.cat.weather) + async def solarweather(self, ctx: commands.Context): + """Gets a solar weather report.""" embed = cmn.embed_factory(ctx) - embed.title = "Current Solar Conditions" + embed.title = "☀️ Current Solar Weather" + if ctx.invoked_with in ["bandconditions", "cond", "condx", "conditions"]: + embed.add_field(name="⚠️ Deprecated Command Alias", + value=(f"This command has been renamed to `{ctx.prefix}solar`!\n" + "The alias you used will be removed in the next version.")) embed.colour = cmn.colours.good embed.set_image(url="http://www.hamqsl.com/solarsun.php") await ctx.send(embed=embed)