aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts
diff options
context:
space:
mode:
authorGravatar vcokltfre <[email protected]>2021-04-12 19:47:41 +0100
committerGravatar vcokltfre <[email protected]>2021-04-12 19:47:41 +0100
commit83245fa2d55e4430d2fff6a9aa6225ac1ee8de08 (patch)
tree6a6f1997e7becee139298d1ffacb854be1dfff12 /bot/exts
parentfix: put april fools video links in correct channel names (diff)
feat: rewrite portion of fool command to allow all videos
Diffstat (limited to 'bot/exts')
-rw-r--r--bot/exts/easter/april_fools_vids.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/bot/exts/easter/april_fools_vids.py b/bot/exts/easter/april_fools_vids.py
index efe7e677..97cb407c 100644
--- a/bot/exts/easter/april_fools_vids.py
+++ b/bot/exts/easter/april_fools_vids.py
@@ -14,7 +14,6 @@ class AprilFoolVideos(commands.Cog):
def __init__(self, bot: commands.Bot):
self.bot = bot
self.yt_vids = self.load_json()
- self.youtubers = ['google'] # will add more in future
@staticmethod
def load_json() -> dict:
@@ -27,10 +26,11 @@ class AprilFoolVideos(commands.Cog):
@commands.command(name='fool')
async def april_fools(self, ctx: commands.Context) -> None:
"""Get a random April Fools' video from Youtube."""
- random_youtuber = random.choice(self.youtubers)
- category = self.yt_vids[random_youtuber]
- random_vid = random.choice(category)
- await ctx.send(f"Check out this April Fools' video by {random_youtuber}.\n\n{random_vid['link']}")
+ video = random.choice(self.yt_vids)
+
+ channel, url = video["channel"], video["url"]
+
+ await ctx.send(f"Check out this April Fools' video by {channel}.\n\n{url}")
def setup(bot: commands.Bot) -> None: