diff options
| author | 2020-10-03 10:09:59 -0700 | |
|---|---|---|
| committer | 2020-10-03 10:09:59 -0700 | |
| commit | a43a650e57093f2154f073ecc703f2a7bf274659 (patch) | |
| tree | a00f48b3bf079c93cb74f87afb5115a89de5f25a | |
| parent | Added responses (diff) | |
@gustavwilliam's suggestions
| -rw-r--r-- | bot/exts/easter/save_the_planet.py | 13 | ||||
| -rw-r--r-- | bot/resources/easter/save_the_planet.json | 32 |
2 files changed, 26 insertions, 19 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)) diff --git a/bot/resources/easter/save_the_planet.json b/bot/resources/easter/save_the_planet.json index eb4304a3..816611c4 100644 --- a/bot/resources/easter/save_the_planet.json +++ b/bot/resources/easter/save_the_planet.json @@ -1,11 +1,11 @@ [ { - "title": "Save the Planet: Choose Reneweable Energy", + "title": "Choose reneweable energy", "image": {"url": "https://cdn.dnaindia.com/sites/default/files/styles/full/public/2019/07/23/851602-renewable-energy-istock-072419.jpg"}, - "footer": {"text": "The best thing you can do is sharing this information!"}, + "footer": {"text": "Help out by sharing this information!"}, "fields": [ { - "name": "The Problem", + "name": "The problem", "value": "Getting energy from oil or fossil fuels isn't a good idea, because there is only so much of it.", "inline": false }, @@ -19,12 +19,12 @@ }, { - "title": "Save the Planet: Save the Trees!", + "title": "Save the trees!", "image": {"url": "https://www.thecollegesolution.com/wp-content/uploads/2014/07/crumpled-paper-1.jpg"}, - "footer": {"text": "The best thing you can do is sharing this information!"}, + "footer": {"text": "Help out by sharing this information!"}, "fields": [ { - "name": "The Problem", + "name": "The problem", "value": "We often waste trees on making paper, and just getting rid of them for no good reason.", "inline": false }, @@ -38,12 +38,12 @@ }, { - "title": "Save the Planet: Less time in the Car!", + "title": "Less time in the car!", "image": {"url": "https://www.careeraddict.com/uploads/article/55294/businessman-riding-bike.jpg"}, - "footer": {"text": "The best thing you can do is sharing this information!"}, + "footer": {"text": "Help out by sharing this information!"}, "fields": [ { - "name": "The Problem", + "name": "The problem", "value": "Every mile you drive to work produces about a pound of C0₂. That's crazy! What's crazier is how clean the planet could be if we spent less time in the car!", "inline": false }, @@ -57,13 +57,19 @@ }, { - "title":"Save the Planet: Paint your roof white!", + "title":"Paint your roof white!", "image": {"url": "https://modernize.com/wp-content/uploads/2016/10/Cool-roof.jpg"}, - "footer": {"text":"The best thing you can do is sharing this information!"}, + "footer": {"text":"Help out by sharing this information!"}, "fields": [ { - "name": "But why?!", - "value": "Having a light-colored roof will reduce the heat coming into your house, which will save your energy bill. Also, Researchers at the Lawrence Berkeley National Laboratory estimated that if 80 percent of roofs in tropical and temperate climate areas were painted white, it could offset the greenhouse gas emissions of 300 million automobiles around the world.", + "name": "The problem", + "value": "People with dark roofs often spend 20 to 40% more on their electricity bills because of the extra heat, which means more electricity needs to be made, and a lot of it isn't renewable.", + "inline": false + }, + + { + "name":"What you can do", + "value": "Having a light colored roof will save you money, and also researchers at the Lawrence Berkeley National Laboratory estimated that if 80 percent of roofs in tropical and temperate climate areas were painted white, it could offset the greenhouse gas emissions of 300 million automobiles around the world.", "inline": false } ] |