aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts
diff options
context:
space:
mode:
authorGravatar Chris Gallardo <[email protected]>2020-10-03 10:09:59 -0700
committerGravatar Chris Gallardo <[email protected]>2020-10-03 10:09:59 -0700
commita43a650e57093f2154f073ecc703f2a7bf274659 (patch)
treea00f48b3bf079c93cb74f87afb5115a89de5f25a /bot/exts
parentAdded responses (diff)
@gustavwilliam's suggestions
Diffstat (limited to 'bot/exts')
-rw-r--r--bot/exts/easter/save_the_planet.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/bot/exts/easter/save_the_planet.py b/bot/exts/easter/save_the_planet.py
index 1494d9f5..46bcb514 100644
--- a/bot/exts/easter/save_the_planet.py
+++ b/bot/exts/easter/save_the_planet.py
@@ -9,20 +9,21 @@ from discord.ext import commands
class SaveThePlanet(commands.Cog):
"""A cog that teaches users how they can help our planet."""
- json_embeds = []
+ embed_data = []
def __init__(self, bot: commands.Bot) -> None:
self.bot = bot
- with open(Path("bot/resources/save_the_planet.json"), 'r', encoding='utf8') as f:
+ with open(Path("bot/resources/easter/save_the_planet.json"), 'r', encoding='utf8') as f:
for embed in json.load(f):
- self.json_embeds.append(embed)
+ self.embed_data.append(embed)
@commands.command(aliases=('savetheearth', 'saveplanet', 'saveearth'))
async def savetheplanet(self, ctx: commands.Context) -> None:
- """Responds with a random tip on how to be ecofriendly and help our planet."""
- await ctx.send(embed=Embed.from_dict(random.choice(self.json_embeds)))
+ """Responds with a random tip on how to be eco-friendly and help our planet."""
+ return_embed = Embed.from_dict(random.choice(self.embed_data))
+ await ctx.send(embed=return_embed)
def setup(bot: commands.Bot) -> None:
- """save_the_planet Cog load."""
+ """Save the Planet Cog load."""
bot.add_cog(SaveThePlanet(bot))