diff options
| author | 2021-09-07 07:34:57 -0400 | |
|---|---|---|
| committer | 2021-09-07 07:34:57 -0400 | |
| commit | 1e711f3e04c6e6adb66159ffbdc4f72740b62fd7 (patch) | |
| tree | af1eae3a95b557ee27cf7577b67b8fecf90b1752 /bot/exts/holidays/valentines/savethedate.py | |
| parent | Added ryanzec_colours.json constructed from ryanzec/name-that-color (diff) | |
| parent | Continue work in progress (diff) | |
Fixing merge conflicts
Diffstat (limited to 'bot/exts/holidays/valentines/savethedate.py')
| -rw-r--r-- | bot/exts/holidays/valentines/savethedate.py | 38 | 
1 files changed, 38 insertions, 0 deletions
| diff --git a/bot/exts/holidays/valentines/savethedate.py b/bot/exts/holidays/valentines/savethedate.py new file mode 100644 index 00000000..3638c1ef --- /dev/null +++ b/bot/exts/holidays/valentines/savethedate.py @@ -0,0 +1,38 @@ +import logging +import random +from json import loads +from pathlib import Path + +import discord +from discord.ext import commands + +from bot.bot import Bot +from bot.constants import Colours + +log = logging.getLogger(__name__) + +HEART_EMOJIS = [":heart:", ":gift_heart:", ":revolving_hearts:", ":sparkling_heart:", ":two_hearts:"] + +VALENTINES_DATES = loads(Path("bot/resources/holidays/valentines/date_ideas.json").read_text("utf8")) + + +class SaveTheDate(commands.Cog): +    """A cog that gives random suggestion for a Valentine's date.""" + +    @commands.command() +    async def savethedate(self, ctx: commands.Context) -> None: +        """Gives you ideas for what to do on a date with your valentine.""" +        random_date = random.choice(VALENTINES_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.pink +        ) +        await ctx.send(embed=embed) + + +def setup(bot: Bot) -> None: +    """Load the Save the date Cog.""" +    bot.add_cog(SaveTheDate()) | 
