aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/evergreen/pythonfacts.py
diff options
context:
space:
mode:
Diffstat (limited to 'bot/exts/evergreen/pythonfacts.py')
-rw-r--r--bot/exts/evergreen/pythonfacts.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/bot/exts/evergreen/pythonfacts.py b/bot/exts/evergreen/pythonfacts.py
index 734782b8..8e6d300b 100644
--- a/bot/exts/evergreen/pythonfacts.py
+++ b/bot/exts/evergreen/pythonfacts.py
@@ -1,13 +1,16 @@
-import random
+import itertools
import discord
from discord.ext import commands
+from bot.constants import Colours
with open('bot/resources/evergreen/python_facts.txt') as file:
FACTS = list(file)
+ FACT_CYCLE = itertools.cycle(FACTS)
-COLORS = [0x4B8BBE, 0xFFD43B, ]
+COLORS = [Colours.python_blue, Colours.python_yellow]
+COLOR_CYCLE = itertools.cycle(COLORS)
class PythonFacts(commands.Cog):
@@ -19,7 +22,7 @@ class PythonFacts(commands.Cog):
@commands.command(name='pythonfact', aliases=['pyfact'])
async def get_python_fact(self, ctx: commands.Context) -> None:
"""Sends a Random fun fact about Python."""
- embed = discord.Embed(title='Python Facts', description=random.choice(FACTS), colour=random.choice(COLORS))
+ embed = discord.Embed(title='Python Facts', description=next(FACT_CYCLE), colour=next(COLOR_CYCLE))
await ctx.send(embed=embed)