aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/halloween/halloween_facts.py
diff options
context:
space:
mode:
Diffstat (limited to 'bot/exts/halloween/halloween_facts.py')
-rw-r--r--bot/exts/halloween/halloween_facts.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/bot/exts/halloween/halloween_facts.py b/bot/exts/halloween/halloween_facts.py
index 98cc2db0..5ad8cc57 100644
--- a/bot/exts/halloween/halloween_facts.py
+++ b/bot/exts/halloween/halloween_facts.py
@@ -25,17 +25,16 @@ SPOOKY_EMOJIS = [
PUMPKIN_ORANGE = 0xFF7518
INTERVAL = timedelta(hours=6).total_seconds()
+FACTS = json.loads(Path("bot/resources/halloween/halloween_facts.json").read_text("utf8"))
+FACTS = list(enumerate(FACTS))
+
class HalloweenFacts(commands.Cog):
"""A Cog for displaying interesting facts about Halloween."""
- def __init__(self):
- self.halloween_facts = json.loads(Path("bot/resources/halloween/halloween_facts.json").read_text("utf8"))
- self.facts = list(enumerate(self.halloween_facts))
-
def random_fact(self) -> Tuple[int, str]:
"""Return a random fact from the loaded facts."""
- return random.choice(self.facts)
+ return random.choice(FACTS)
@commands.command(name="spookyfact", aliases=("halloweenfact",), brief="Get the most recent Halloween fact")
async def get_random_fact(self, ctx: commands.Context) -> None: