aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/evergreen/pythonfacts.py
diff options
context:
space:
mode:
authorGravatar MrKomodoDragon <[email protected]>2021-02-23 09:03:05 -0800
committerGravatar MrKomodoDragon <[email protected]>2021-02-23 09:03:05 -0800
commitaef25cb560eb525305c583a8ff2834b503cb91d4 (patch)
tree3670e2ecf1c239e8082931f5620d52d6fac3658f /bot/exts/evergreen/pythonfacts.py
parentSwitch to itertools.cycle and add colors to constants.py (diff)
Remove unused variables
Diffstat (limited to 'bot/exts/evergreen/pythonfacts.py')
-rw-r--r--bot/exts/evergreen/pythonfacts.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/bot/exts/evergreen/pythonfacts.py b/bot/exts/evergreen/pythonfacts.py
index 8e6d300b..11b258f9 100644
--- a/bot/exts/evergreen/pythonfacts.py
+++ b/bot/exts/evergreen/pythonfacts.py
@@ -6,11 +6,9 @@ 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)
+ FACTS = itertools.cycle(list(file))
-COLORS = [Colours.python_blue, Colours.python_yellow]
-COLOR_CYCLE = itertools.cycle(COLORS)
+COLORS = itertools.cycle([Colours.python_blue, Colours.python_yellow])
class PythonFacts(commands.Cog):
@@ -22,7 +20,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=next(FACT_CYCLE), colour=next(COLOR_CYCLE))
+ embed = discord.Embed(title='Python Facts', description=next(FACTS), colour=next(COLORS))
await ctx.send(embed=embed)