From 118d5e0b637fc3af359dd0e4354f42945e47a837 Mon Sep 17 00:00:00 2001 From: Abigail Gold Date: Sat, 4 Jan 2020 14:40:08 -0500 Subject: [PATCH 1/3] add --link flag to only link the qrz page (rather than embed) --- exts/qrz.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/exts/qrz.py b/exts/qrz.py index 6e8a86d..c2576c4 100644 --- a/exts/qrz.py +++ b/exts/qrz.py @@ -25,9 +25,11 @@ class QRZCog(commands.Cog): self._qrz_session_init.start() @commands.command(name="call", aliases=["qrz"], category=cmn.cat.lookup) - async def _qrz_lookup(self, ctx: commands.Context, callsign: str): - '''Look up a callsign on [QRZ.com](https://www.qrz.com/).''' - if keys.qrz_user == '' or keys.qrz_pass == '': + async def _qrz_lookup(self, ctx: commands.Context, callsign: str, *flags): + '''Look up a callsign on [QRZ.com](https://www.qrz.com/). Add `--link` to only link the QRZ page.''' + flags = [f.lower() for f in flags] + + if keys.qrz_user == '' or keys.qrz_pass == '' or '--link' in flags: await ctx.send(f'http://qrz.com/db/{callsign}') return From 673d154b94103b566f43858ac9f4899964636b91 Mon Sep 17 00:00:00 2001 From: Abigail Gold Date: Sat, 4 Jan 2020 14:46:40 -0500 Subject: [PATCH 2/3] add category to prefixes command Fixes #148 --- exts/ham.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exts/ham.py b/exts/ham.py index 7793a87..a040ceb 100644 --- a/exts/ham.py +++ b/exts/ham.py @@ -65,7 +65,7 @@ class HamCog(commands.Cog): embed.colour = cmn.colours.good await ctx.send(embed=embed) - @commands.command(name="prefixes", aliases=["vanity", "pfx", "vanities", "prefix"]) + @commands.command(name="prefixes", aliases=["vanity", "pfx", "vanities", "prefix"], category=cmn.cat.ref) async def _vanity_prefixes(self, ctx: commands.Context, country: str = None): '''Lists valid prefixes for countries.''' if country is None: From 8a9c8cbd430340aa444672d45a7f5fd33d72497f Mon Sep 17 00:00:00 2001 From: Abigail Gold Date: Sat, 4 Jan 2020 16:38:52 -0500 Subject: [PATCH 3/3] update changelog for qrz --link --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b38bda7..499f902 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] +### Changed +- The qrz command can now link to a QRZ page instead of embedding the data with the `--link` flag. ## [v2.1.0] - 2020-01-04