From 8ca491107263e3ab8cdf0a901462bf6caeb9372f Mon Sep 17 00:00:00 2001 From: Abigail Gold <5366828+classabbyamp@users.noreply.github.com> Date: Sat, 28 Mar 2020 23:07:23 +0000 Subject: [PATCH] make commands case-insensitive (#210) Fixes #209 --- CHANGELOG.md | 8 +++++++- exts/ae7q.py | 2 +- exts/weather.py | 2 +- main.py | 6 +++--- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5472dc..9de0062 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] +## [2.2.3] - 2020-03-28 +### Fixed +- Commands are no longer case-sensitive. + + ## [2.2.2] - 2020-02-25 ### Fixed - Fixed issue where HamStudy questions with images would cause an error. @@ -87,7 +92,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## 1.0.0 - 2019-07-31 [YANKED] -[Unreleased]: https://github.com/miaowware/qrm2/compare/v2.2.2...HEAD +[Unreleased]: https://github.com/miaowware/qrm2/compare/v2.2.3...HEAD +[2.2.3]: https://github.com/miaowware/qrm2/releases/tag/v2.2.3 [2.2.2]: https://github.com/miaowware/qrm2/releases/tag/v2.2.2 [2.2.1]: https://github.com/miaowware/qrm2/releases/tag/v2.2.1 [2.2.0]: https://github.com/miaowware/qrm2/releases/tag/v2.2.0 diff --git a/exts/ae7q.py b/exts/ae7q.py index 9f3ecc9..b11aeeb 100644 --- a/exts/ae7q.py +++ b/exts/ae7q.py @@ -29,7 +29,7 @@ class AE7QCog(commands.Cog): self.bot = bot self.session = aiohttp.ClientSession(connector=bot.qrm.connector) - @commands.group(name="ae7q", aliases=["ae"], category=cmn.cat.lookup) + @commands.group(name="ae7q", aliases=["ae"], case_insensitive=True, category=cmn.cat.lookup) async def _ae7q_lookup(self, ctx: commands.Context): """Looks up a callsign, FRN, or Licensee ID on [ae7q.com](http://ae7q.com/).""" if ctx.invoked_subcommand is None: diff --git a/exts/weather.py b/exts/weather.py index dc4319a..2587428 100644 --- a/exts/weather.py +++ b/exts/weather.py @@ -40,7 +40,7 @@ class WeatherCog(commands.Cog): embed.set_image(url="attachment://condx.png") await ctx.send(embed=embed, file=discord.File(data, "condx.png")) - @commands.group(name="weather", aliases=["wttr"], category=cmn.cat.weather) + @commands.group(name="weather", aliases=["wttr"], case_insensitive=True, category=cmn.cat.weather) async def _weather_conditions(self, ctx: commands.Context): """Gets local weather conditions from [wttr.in](http://wttr.in/). diff --git a/main.py b/main.py index ac7d400..bc9f919 100644 --- a/main.py +++ b/main.py @@ -45,8 +45,8 @@ loop = asyncio.get_event_loop() connector = loop.run_until_complete(conn.new_connector()) bot = commands.Bot(command_prefix=opt.prefix, - description=info.description, - help_command=commands.MinimalHelpCommand(), + case_insensitive=True, + description=info.description, help_command=commands.MinimalHelpCommand(), loop=loop, connector=connector) @@ -82,7 +82,7 @@ async def _shutdown_bot(ctx: commands.Context): await bot.logout() -@bot.group(name="extctl", aliases=["ex"], category=cmn.cat.admin) +@bot.group(name="extctl", aliases=["ex"], case_insensitive=True, category=cmn.cat.admin) @commands.check(cmn.check_if_owner) async def _extctl(ctx: commands.Context): """Extension control commands.