diff options
author | 2019-08-12 16:41:19 -0400 | |
---|---|---|
committer | 2019-08-12 16:41:19 -0400 | |
commit | 12aefcf543ae5e2fb00ddc1dd0fbebadab0691d5 (patch) | |
tree | 96845cba8c8d1487259ec1ce31d68e755989402a | |
parent | Cleaned up lint issues with speedrun (diff) |
Cleaned speedrun.py, removed duplicate in json file
-rw-r--r-- | bot/resources/evergreen/speedrun_links.json | 10 | ||||
-rw-r--r-- | bot/seasons/evergreen/speedrun.py | 16 |
2 files changed, 9 insertions, 17 deletions
diff --git a/bot/resources/evergreen/speedrun_links.json b/bot/resources/evergreen/speedrun_links.json index 1ae1e325..acb5746a 100644 --- a/bot/resources/evergreen/speedrun_links.json +++ b/bot/resources/evergreen/speedrun_links.json @@ -1,5 +1,4 @@ -{ - "links": [ + [ "https://www.youtube.com/watch?v=jNE28SDXdyQ", "https://www.youtube.com/watch?v=iI8Giq7zQDk", "https://www.youtube.com/watch?v=VqNnkqQgFbc", @@ -12,9 +11,8 @@ "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 + "https://www.youtube.com/watch?v=67kQ3l-1qMs", + "https://www.youtube.com/watch?v=14wqBA5Q1yc" +] diff --git a/bot/seasons/evergreen/speedrun.py b/bot/seasons/evergreen/speedrun.py index e3ecdca2..9123bb84 100644 --- a/bot/seasons/evergreen/speedrun.py +++ b/bot/seasons/evergreen/speedrun.py @@ -3,33 +3,27 @@ import logging from pathlib import Path from random import choice - from discord.ext import commands - log = logging.getLogger(__name__) class Speedrun(commands.Cog): - """A command that will link a random speedrun video from youtube to Discord.""" + """Commands about the video game speedrunning community.""" 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. - """ + """Sends a link to a video of a random speedrun.""" with open(Path('bot/resources/evergreen/speedrun_links.json')) as file: data = json.load(file) - links = data['links'] - await ctx.send(choice(links)) + # links = data['links'] + await ctx.send(choice(data)) def setup(bot): - """Cog load""" + """Load the Speedrun cog""" bot.add_cog(Speedrun(bot)) log.info("Speedrun cog loaded") |