aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/holidays/valentines/savethedate.py
blob: 073a6331fb024dda644555ce25526d8c14fcb842 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import random
from json import loads
from pathlib import Path

import discord
from discord.ext import commands
from pydis_core.utils.logging import get_logger

from bot.bot import Bot
from bot.constants import Colours

log = get_logger(__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)


async def setup(bot: Bot) -> None:
    """Load the Save the date Cog."""
    await bot.add_cog(SaveTheDate())