Move current_election setting. The bot needs to be ready first.
build_develop / build (push) Successful in 1m22s
build_develop / build (push) Successful in 1m22s
This commit is contained in:
@@ -19,7 +19,7 @@ class DailyLoop(commands.Cog, name="Daily Loop"):
|
|||||||
|
|
||||||
def __init__(self, bot: commands.Bot) -> None:
|
def __init__(self, bot: commands.Bot) -> None:
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
self.current_election = self.get_current_cycle()
|
self.current_election = None
|
||||||
|
|
||||||
@commands.Cog.listener()
|
@commands.Cog.listener()
|
||||||
async def on_ready(self):
|
async def on_ready(self):
|
||||||
@@ -27,6 +27,10 @@ class DailyLoop(commands.Cog, name="Daily Loop"):
|
|||||||
Starts the loop when bot is ready.
|
Starts the loop when bot is ready.
|
||||||
"""
|
"""
|
||||||
await self.bot.wait_until_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.
|
# pylint doesn't recognize that periodic_update_guild_data is subclassed from tasks.loop.
|
||||||
await self.daily_loop.start() # pylint: disable=no-member
|
await self.daily_loop.start() # pylint: disable=no-member
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user