From 5baf08622b7bdbe9cb23b68c74c5624b6afabe26 Mon Sep 17 00:00:00 2001 From: AvianAnalyst Date: Thu, 20 Jun 2019 01:34:51 -0400 Subject: Clarified doc strings and tidied code per requests --- bot/seasons/pride/pride_anthem.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'bot') 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']) -- cgit v1.2.3