diff --git a/cogs/loops/daily_loop.py b/cogs/loops/daily_loop.py index b18046f..61cde16 100644 --- a/cogs/loops/daily_loop.py +++ b/cogs/loops/daily_loop.py @@ -19,7 +19,7 @@ class DailyLoop(commands.Cog, name="Daily Loop"): def __init__(self, bot: commands.Bot) -> None: self.bot = bot - self.current_election = self.get_current_cycle() + self.current_election = None @commands.Cog.listener() async def on_ready(self): @@ -27,6 +27,10 @@ class DailyLoop(commands.Cog, name="Daily Loop"): Starts the loop when bot is ready. """ await self.bot.wait_until_ready() + + # wait until the discord bot is all ready. Bot needs to know guilds. + self.current_election = self.get_current_cycle() + # pylint doesn't recognize that periodic_update_guild_data is subclassed from tasks.loop. await self.daily_loop.start() # pylint: disable=no-member