diff options
author | 2019-06-20 01:34:51 -0400 | |
---|---|---|
committer | 2019-06-20 01:34:51 -0400 | |
commit | 5baf08622b7bdbe9cb23b68c74c5624b6afabe26 (patch) | |
tree | 98f3eddc791b4e055495bc1697a8f1391e1ff4c6 | |
parent | Implemented review suggestions. (diff) |
Clarified doc strings and tidied code per requests
-rw-r--r-- | bot/seasons/pride/pride_anthem.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/bot/seasons/pride/pride_anthem.py b/bot/seasons/pride/pride_anthem.py index ff396c04..e2461c5d 100644 --- a/bot/seasons/pride/pride_anthem.py +++ b/bot/seasons/pride/pride_anthem.py @@ -34,13 +34,17 @@ class PrideAnthem(commands.Cog): @staticmethod def load_vids() -> list: """Loads a list of videos from the resources folder as dictionaries.""" - with open(Path('bot/resources/pride/anthems.json').absolute(), 'r') as f: + with open(Path('bot/resources/pride/anthems.json'), 'r', encoding='utf-8') as f: anthems = json.load(f) return anthems - @commands.group(aliases=["prideanthem", "anthem", "pridesong"], invoke_without_command=True) - async def send_anthem(self, ctx, genre: str = None): - """Generates and sends message with youtube link.""" + @commands.command(name='prideanthem', aliases=['anthem', 'pridesong']) + async def prideanthem(self, ctx, genre: str = None): + """ + Sends a message with a video of a random pride anthem. + + If `genre` is supplied, it will select from that genre only. + """ anthem = self.get_video(genre) if anthem: await ctx.send(anthem['url']) |