diff options
author | 2019-06-18 12:02:08 -0400 | |
---|---|---|
committer | 2019-06-18 12:02:08 -0400 | |
commit | 655855daceeceefe3c43ae46e14d4ca2ef07c7de (patch) | |
tree | 206cf6e28c761cdd15c2e31ac0ef00364990769c | |
parent | Added type hints (diff) |
Lint and add doc strings
-rw-r--r-- | bot/seasons/pride/pride_anthem.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bot/seasons/pride/pride_anthem.py b/bot/seasons/pride/pride_anthem.py index 0e2ee9c9..26d5c7cc 100644 --- a/bot/seasons/pride/pride_anthem.py +++ b/bot/seasons/pride/pride_anthem.py @@ -16,6 +16,12 @@ class PrideAnthem(commands.Cog): self.anthems = self.load_vids() def get_video(self, genre: str = None) -> dict: + """ + Picks a random anthem from the list. + + If `genre` is supplied, it will pick from videos attributed with that genre. + If none can be found, it will log this as well as provide that information to the user. + """ if not genre: return choice(self.anthems) else: @@ -27,15 +33,15 @@ 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: anthems = load(f) return anthems @commands.command(name='prideanthem') async def send_anthem(self, ctx, genre: str = None): + """Generates and sends message with youtube link""" anthem = self.get_video(genre) - # embed = Embed(title='Pride Anthem', - # description="Here is a pride anthem to check out!") if anthem: await ctx.send(anthem['url']) else: |