Merge pull request #114 from classabbyamp/updateclog

Update changelog for v2.0.0
This commit is contained in:
Abigail Gold 2019-12-16 00:22:28 -05:00 committed by GitHub
commit caa74142d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 40 additions and 26 deletions

View File

@ -4,22 +4,34 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased] ## [Unreleased]
## [v2.0.0] - 2019-12-16
### Added ### Added
- Global info, secrets, and options are now stored in their own files, using [0x5c/quick-bot-no-pain](https://github.com/0x5c/quick-bot-no-pain) - Rich lookup for AE7Q.com (callsigns only, more to come)
- Rich lookup for AE7Q (callsigns only, more to come) - Rich lookup for QRZ.com, if a QRZ subscription is present
- Rich lookup for QRZ, if a QRZ subscription is present - Current and 3-Day forecast for terrestrial weather conditions lookup commands
- Timestamp and requester username and avatar are now shown on embeds
- Current and 3-Day Forecast terrestrial weather conditions lookup commands
- Extension control commands.
- Changelog command - Changelog command
- Command to show callsign rules
- Extension control commands
- Timestamp and requester username and avatar are now shown on embeds
- Docker support, including an [official docker image](https://hub.docker.com/r/classabbyamp/discord-qrm2) and instructions for running the bot in docker
- Global info, secrets, and options are now stored in their own files, based on [0x5c/quick-bot-no-pain](https://github.com/0x5c/quick-bot-no-pain)
### Changed ### Changed
- Rewrote code to take advantage of discord.py's cogs - Improved the help command, taking advantage of discord.py's new features
- Moved most bot responses into embeds - Improved command and argument names to be more clear
- Re-implemented shutdown and restart commands using discord.py checks
- Embed colors now fit with discord's theme - Embed colors now fit with discord's theme
- The contest calendar command no longer relies on `selenium` - Re-implemented shutdown and restart commands using discord.py checks
- The contest calendar command no longer relies on `selenium` (more improvements to come)
- Rewrote code to take advantage of discord.py's cogs and extensions
- Moved most bot responses into embeds
### Removed ### Removed
- CTY.DAT parsing is now its own library (`ctyparser` available on pypi) - CTY.DAT parsing is now its own library ([`ctyparser` available on pypi](https://pypi.org/project/ctyparser/))
- Removed Herobrine - Removed Herobrine
### Fixed ### Fixed
- Cleaned up code to comply with the PEP8 Standard - Cleaned up code to comply with the PEP8 Standard
- Issue in morse and unmorse commands where spaces were not interpreted correctly
## v1.0.0 - 2019-07-31 [YANKED]
[Unreleased]: https://github.com/classabbyamp/discord-qrm2/compare/v2.0.0...HEAD
[v2.0.0]: https://github.com/classabbyamp/discord-qrm2/releases/tag/v2.0.0

View File

@ -139,7 +139,7 @@ class BaseCog(commands.Cog):
@commands.command(name="changelog", aliases=["clog"]) @commands.command(name="changelog", aliases=["clog"])
async def _changelog(self, ctx: commands.Context): async def _changelog(self, ctx: commands.Context):
"""Show what has changed in recent bot versions.""" """Show what has changed in the most recent bot version."""
embed = discord.Embed(title="qrm Changelog", embed = discord.Embed(title="qrm Changelog",
description=("For a full listing, visit [Github](https://" description=("For a full listing, visit [Github](https://"
"github.com/classabbyamp/discord-qrm2/blob/master/CHANGELOG.md)."), "github.com/classabbyamp/discord-qrm2/blob/master/CHANGELOG.md)."),
@ -153,12 +153,12 @@ class BaseCog(commands.Cog):
for ver, log in changelog.items(): for ver, log in changelog.items():
if ver.lower() != 'unreleased': if ver.lower() != 'unreleased':
if 'date' in log: if 'date' in log:
header = f'**{ver}** ({log["date"]})' embed.description += f'\n\n**{ver}** ({log["date"]})'
else: else:
header = f'**{ver}**' embed.description += f'\n\n**{ver}**'
embed.add_field(name=header, value=await format_changelog(log), inline=False) embed = await format_changelog(log, embed)
vers += 1 vers += 1
if vers >= 2: if vers >= 1:
break break
await ctx.send(embed=embed) await ctx.send(embed=embed)
@ -175,26 +175,28 @@ def parse_changelog():
continue continue
if re.match(r'##[^#]', line): if re.match(r'##[^#]', line):
ver_match = re.match(r'\[(.+)\](?: - )?(\d{4}-\d{2}-\d{2})?', line.lstrip('#').strip()) ver_match = re.match(r'\[(.+)\](?: - )?(\d{4}-\d{2}-\d{2})?', line.lstrip('#').strip())
ver = ver_match.group(1) if ver_match is not None:
changelog[ver] = dict() ver = ver_match.group(1)
if ver_match.group(2): changelog[ver] = dict()
changelog[ver]['date'] = ver_match.group(2) if ver_match.group(2):
changelog[ver]['date'] = ver_match.group(2)
elif re.match(r'###[^#]', line): elif re.match(r'###[^#]', line):
heading = line.lstrip('#').strip() heading = line.lstrip('#').strip()
changelog[ver][heading] = [] changelog[ver][heading] = []
elif ver != '' and heading != '': elif ver != '' and heading != '':
changelog[ver][heading].append(line.lstrip('-').strip()) if line.startswith('-'):
changelog[ver][heading].append(line.lstrip('-').strip())
return changelog return changelog
async def format_changelog(log: dict): async def format_changelog(log: dict, embed: discord.Embed):
formatted = ''
for header, lines in log.items(): for header, lines in log.items():
formatted = ''
if header != 'date': if header != 'date':
formatted += f'**{header}**\n'
for line in lines: for line in lines:
formatted += f'- {line}\n' formatted += f'- {line}\n'
return formatted embed.add_field(name=f'**{header}**', value=formatted, inline=False)
return embed
def setup(bot: commands.Bot): def setup(bot: commands.Bot):

View File

@ -24,4 +24,4 @@ authors = ("@ClassAbbyAmplifier#2229", "@0x5c#0639")
description = """A bot with various useful ham radio-related functions, written in Python.""" description = """A bot with various useful ham radio-related functions, written in Python."""
license = "Released under the GNU General Public License v2" license = "Released under the GNU General Public License v2"
contributing = "Check out the source on GitHub, contributions welcome: https://github.com/classabbyamp/discord-qrm2" contributing = "Check out the source on GitHub, contributions welcome: https://github.com/classabbyamp/discord-qrm2"
release = '1.0.0' release = '2.0.0'