aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Rohan <[email protected]>2019-02-07 23:28:38 +0530
committerGravatar Rohan <[email protected]>2019-02-07 23:28:38 +0530
commiteff83ef69532e8cde8384fd4ba53eda249e8ce9b (patch)
tree518ee662496bdc72e3e40e11097194278ed960e2
parentfixed linter errors (diff)
added a color called bright_green to the colors class.gave the variables more descriptive names.
-rw-r--r--bot/constants.py1
-rw-r--r--bot/seasons/valentines/savethedate.py19
2 files changed, 11 insertions, 9 deletions
diff --git a/bot/constants.py b/bot/constants.py
index 63f923d4..ec8a1a4d 100644
--- a/bot/constants.py
+++ b/bot/constants.py
@@ -61,6 +61,7 @@ class Client(NamedTuple):
class Colours:
soft_red = 0xcd6d6d
soft_green = 0x68c290
+ bright_green = 0x01d277
dark_green = 0x1f8b4c
orange = 0xe67e22
pink = 0xcf84e0
diff --git a/bot/seasons/valentines/savethedate.py b/bot/seasons/valentines/savethedate.py
index 78a0f1f5..e978d624 100644
--- a/bot/seasons/valentines/savethedate.py
+++ b/bot/seasons/valentines/savethedate.py
@@ -6,15 +6,16 @@ from pathlib import Path
import discord
from discord.ext import commands
+from bot.constants import Colours
log = logging.getLogger(__name__)
-emoji = [":heart:", ":couple_with_heart:", ":gift_heart:", ":revolving_hearts:", ":sparkling_heart:", ":two_hearts:"]
+HEART_EMOJIS = [":heart:", ":gift_heart:", ":revolving_hearts:", ":sparkling_heart:", ":two_hearts:"]
class SaveTheDate:
"""
- A cog to change a invokers nickname to a spooky one!
+ A cog that gives random suggestion, for a valentines date !
"""
def __init__(self, bot):
@@ -23,13 +24,13 @@ class SaveTheDate:
@commands.command()
async def savethedate(self, ctx):
with open(Path('bot', 'resources', 'valentines', 'date_ideas.json'), 'r', encoding="utf8") as f:
- data = load(f)
- date_idea = random.choice(data['ideas'])
- emoji_1 = random.choice(emoji)
- emoji_2 = random.choice(emoji)
- embed = discord.Embed(title=date_idea['name'],
- description=f"{emoji_1}{date_idea['description']}{emoji_2}",
- colour=0x01d277)
+ valentine_dates = load(f)
+ random_date = random.choice(valentine_dates['ideas'])
+ emoji_1 = random.choice(HEART_EMOJIS)
+ emoji_2 = random.choice(HEART_EMOJIS)
+ embed = discord.Embed(title=f"{emoji_1}{random_date['name']}{emoji_2}",
+ description=f"{random_date['description']}",
+ colour=Colours.bright_green)
await ctx.send(embed=embed)