diff options
Diffstat (limited to 'bot/exts/holidays/easter/traditions.py')
| -rw-r--r-- | bot/exts/holidays/easter/traditions.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/bot/exts/holidays/easter/traditions.py b/bot/exts/holidays/easter/traditions.py new file mode 100644 index 00000000..f54ab5c4 --- /dev/null +++ b/bot/exts/holidays/easter/traditions.py @@ -0,0 +1,28 @@ +import json +import logging +import random +from pathlib import Path + +from discord.ext import commands + +from bot.bot import Bot + +log = logging.getLogger(__name__) + +traditions = json.loads(Path("bot/resources/holidays/easter/traditions.json").read_text("utf8")) + + +class Traditions(commands.Cog): + """A cog which allows users to get a random easter tradition or custom from a random country.""" + + @commands.command(aliases=("eastercustoms",)) + async def easter_tradition(self, ctx: commands.Context) -> None: + """Responds with a random tradition or custom.""" + random_country = random.choice(list(traditions)) + + await ctx.send(f"{random_country}:\n{traditions[random_country]}") + + +def setup(bot: Bot) -> None: + """Load the Traditions Cog.""" + bot.add_cog(Traditions()) |