diff options
-rw-r--r-- | bot/seasons/easter/traditions.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/bot/seasons/easter/traditions.py b/bot/seasons/easter/traditions.py index d9ef74e7..e5656be3 100644 --- a/bot/seasons/easter/traditions.py +++ b/bot/seasons/easter/traditions.py @@ -1,33 +1,33 @@ import json import logging import random +from pathlib import Path from discord.ext import commands log = logging.getLogger(__name__) +with open(Path('bot', 'resources', , 'easter', 'traditions.json', 'r', encoding="utf8") as f: + traditions = json.load(f) -class Traditions(commands.Cog): - """A cog which allows users to get a random easter tradition or custom from a random country.""" - def __init__(self, bot): - self.bot = bot +class Traditions(commands.Cog): + """A cog which allows users to get a random easter tradition or custom from a random country.""" - @commands.command(name="easter_tradition") - async def easter_tradition(self, ctx): - """Responds with a random tradition or custom""" + def __init__(self, bot): + self.bot = bot - traditions = {} - with open('userbalance.json', 'r') as f: - traditions = json.load(f) + @commands.command(alias='eastercustoms') + async def easter_tradition(self, ctx): + """Responds with a random tradition or custom""" - random_country = random.choice(list(traditions)) + random_country = random.choice(list(traditions)) - await ctx.send(f"{random_country}:\n{traditions[random_country]}") + await ctx.send(f"{random_country}:\n{traditions[random_country]}") def setup(bot): - """Traditions Cog load.""" + """Traditions Cog load.""" - bot.add_cog(Traditions(bot)) - log.info("Traditions cog loaded") + bot.add_cog(Traditions(bot)) + log.info("Traditions cog loaded") |