aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore5
-rw-r--r--bot/resources/evergreen/speedrun_links.json20
-rw-r--r--bot/seasons/evergreen/speedrun.py34
3 files changed, 58 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 8f848483..8a21b668 100644
--- a/.gitignore
+++ b/.gitignore
@@ -111,4 +111,7 @@ venv.bak/
# jetbrains
.idea/
-.DS_Store \ No newline at end of file
+.DS_Store
+
+# vscode
+.vscode/
diff --git a/bot/resources/evergreen/speedrun_links.json b/bot/resources/evergreen/speedrun_links.json
new file mode 100644
index 00000000..1ae1e325
--- /dev/null
+++ b/bot/resources/evergreen/speedrun_links.json
@@ -0,0 +1,20 @@
+{
+ "links": [
+ "https://www.youtube.com/watch?v=jNE28SDXdyQ",
+ "https://www.youtube.com/watch?v=iI8Giq7zQDk",
+ "https://www.youtube.com/watch?v=VqNnkqQgFbc",
+ "https://www.youtube.com/watch?v=Gum4GI2Jr0s",
+ "https://www.youtube.com/watch?v=5YHjHzHJKkU",
+ "https://www.youtube.com/watch?v=X0pJSTy4tJI",
+ "https://www.youtube.com/watch?v=aVFq0H6D6_M",
+ "https://www.youtube.com/watch?v=1O6LuJbEbSI",
+ "https://www.youtube.com/watch?v=Bgh30BiWG58",
+ "https://www.youtube.com/watch?v=wwvgAAvhxM8",
+ "https://www.youtube.com/watch?v=0TWQr0_fi80",
+ "https://www.youtube.com/watch?v=hatqZby-0to",
+ "https://www.youtube.com/watch?v=X0pJSTy4tJI",
+ "https://www.youtube.com/watch?v=tmnMq2Hw72w",
+ "https://www.youtube.com/watch?v=UTkyeTCAucA",
+ "https://www.youtube.com/watch?v=67kQ3l-1qMs"
+ ]
+} \ No newline at end of file
diff --git a/bot/seasons/evergreen/speedrun.py b/bot/seasons/evergreen/speedrun.py
new file mode 100644
index 00000000..8bbbfc83
--- /dev/null
+++ b/bot/seasons/evergreen/speedrun.py
@@ -0,0 +1,34 @@
+import json
+import logging
+from random import choice
+from discord.ext import commands
+from pathlib import Path
+
+
+log = logging.getLogger(__name__)
+
+
+class Speedrun(commands.Cog):
+ """
+ A command that will link a random speedrun video from youtube to Discord.
+ """
+
+ def __init__(self, bot):
+ self.bot = bot
+
+ @commands.command(name="speedrun")
+ async def get_speedrun(self, ctx):
+ """
+ Sends a link to Discord of a random speedrun from youtube.
+ Utilizes speedrun_links.json to find links.
+ """
+
+ with open(Path('bot/resources/evergreen/speedrun_links.json')) as file:
+ data = json.load(file)
+ links = data['links']
+ await ctx.send(choice(links))
+
+
+def setup(bot):
+ bot.add_cog(Speedrun(bot))
+ log.info("Speedrun cog loaded")