diff options
| author | 2020-10-05 14:54:50 -0700 | |
|---|---|---|
| committer | 2020-10-05 14:54:50 -0700 | |
| commit | afaa15d3dc6e81f09ccf9e0d4cb33715aae8aedc (patch) | |
| tree | fc6042a7d2e4ba8a825744ef8e26859816689980 | |
| parent | apply @Den4200's suggestions (diff) | |
apply @Den4200's suggestions
Co-Authored-By: Dennis Pham <[email protected]>
| -rw-r--r-- | bot/exts/easter/save_the_planet.py | 10 | 
1 files changed, 4 insertions, 6 deletions
| diff --git a/bot/exts/easter/save_the_planet.py b/bot/exts/easter/save_the_planet.py index 99f06bbc..8f644259 100644 --- a/bot/exts/easter/save_the_planet.py +++ b/bot/exts/easter/save_the_planet.py @@ -4,9 +4,11 @@ from pathlib import Path  from discord import Embed  from discord.ext import commands -from bot.utils import RandomCycle +from bot.utils.randomization import RandomCycle -EMBED_DATA = [] + +with Path("bot/resources/easter/save_the_planet.json").open('r', encoding='utf8') as f: +    EMBED_DATA = RandomCycle(json.load(f))  class SaveThePlanet(commands.Cog): @@ -15,10 +17,6 @@ class SaveThePlanet(commands.Cog):      def __init__(self, bot: commands.Bot) -> None:          self.bot = bot -        with Path("bot/resources/easter/save_the_planet.json").open('r', encoding='utf8') as f: -            global EMBED_DATA -            EMBED_DATA = RandomCycle(json.load(f)) -      @commands.command(aliases=('savetheearth', 'saveplanet', 'saveearth'))      async def savetheplanet(self, ctx: commands.Context) -> None:          """Responds with a random tip on how to be eco-friendly and help our planet.""" | 
