aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar jakeHebert <[email protected]>2019-08-12 17:41:30 -0400
committerGravatar jakeHebert <[email protected]>2019-08-12 17:41:30 -0400
commit1c9221cee0eb33355e6a8063542d3452fd2ac362 (patch)
tree562b5d75f2098c09a41eb66f0d0b44db8341a645
parentremoved old comment, added encoding to open statment, moved data grab to init (diff)
moved data grab to module level, changed var to constant
Diffstat (limited to '')
-rw-r--r--bot/seasons/evergreen/speedrun.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/bot/seasons/evergreen/speedrun.py b/bot/seasons/evergreen/speedrun.py
index 3cf531bf..f6a43a63 100644
--- a/bot/seasons/evergreen/speedrun.py
+++ b/bot/seasons/evergreen/speedrun.py
@@ -6,6 +6,8 @@ from random import choice
from discord.ext import commands
log = logging.getLogger(__name__)
+with Path('bot/resources/evergreen/speedrun_links.json').open(encoding="utf-8") as file:
+ LINKS = json.load(file)
class Speedrun(commands.Cog):
@@ -13,13 +15,11 @@ class Speedrun(commands.Cog):
def __init__(self, bot):
self.bot = bot
- with Path('bot/resources/evergreen/speedrun_links.json').open(encoding="utf-8") as file:
- self.data = json.load(file)
@commands.command(name="speedrun")
async def get_speedrun(self, ctx):
"""Sends a link to a video of a random speedrun."""
- await ctx.send(choice(self.data))
+ await ctx.send(choice(LINKS))
def setup(bot):