changelog command finished

This commit is contained in:
Abigail Gold 2019-10-30 15:26:29 -04:00
parent 12a7f9bbac
commit 94109b7a94
No known key found for this signature in database
GPG Key ID: 80A676456AB6B045
2 changed files with 12 additions and 1 deletions

View File

@ -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

View File

@ -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)