From 94109b7a947df85be13305e9e5514d5599a9ae8c Mon Sep 17 00:00:00 2001 From: Abigail Gold Date: Wed, 30 Oct 2019 15:26:29 -0400 Subject: [PATCH] changelog command finished --- CHANGELOG.md | 1 + cogs/basecog.py | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a15db8..f44c0cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Rich lookup for QRZ, if a QRZ subscription is present - Timestamp and requester username and avatar are now shown on embeds - Current and 3-Day Forecast terrestrial weather conditions lookup commands +- Changelog command ### Changed - Rewrote code to take advantage of discord.py's cogs - Moved most bot responses into embeds diff --git a/cogs/basecog.py b/cogs/basecog.py index 60d95e1..1a3de11 100644 --- a/cogs/basecog.py +++ b/cogs/basecog.py @@ -49,14 +49,24 @@ class BaseCog(commands.Cog): async def _changelog(self, ctx: commands.Context): """Show what has changed in recent bot versions.""" embed = discord.Embed(title="qrm Changelog", + description="For a full listing, visit [Github](https://github.com/classabbyamp/discord-qrm-bot/blob/master/CHANGELOG.md).", colour=self.gs.colours.neutral, timestamp=datetime.utcnow()) embed.set_footer(text=ctx.author.name, icon_url=str(ctx.author.avatar_url)) changelog = await parse_changelog() + vers = 0 for ver, log in changelog.items(): - embed.add_field(name=ver, value=await format_changelog(log), inline=False) + if ver.lower() != 'unreleased': + if 'date' in log: + header = f'**{ver}** ({log["date"]})' + else: + header = f'**{ver}**' + embed.add_field(name=header, value=await format_changelog(log), inline=False) + vers += 1 + if vers >= 2: + break await ctx.send(embed=embed)