From 7e3b59ea5905cd2d39b37bb3caed50499b5e6df4 Mon Sep 17 00:00:00 2001 From: imcompiling Date: Tue, 25 Jul 2023 16:00:49 -0400 Subject: [PATCH] clean up election_cycle constructor. --- classes/election_cycle.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/classes/election_cycle.py b/classes/election_cycle.py index c2e4a60..1dca109 100644 --- a/classes/election_cycle.py +++ b/classes/election_cycle.py @@ -5,7 +5,6 @@ Contains the election cycle class from datetime import datetime, timedelta import nextcord -from nextcord.ext import commands from sqlalchemy import select from sqlalchemy.orm import Session @@ -20,7 +19,7 @@ class ElectionCycle: the cycle. """ - def __init__(self, cycle: int, bot: commands.Bot) -> None: + def __init__(self, cycle: int, config: DakinyConfig, guild: nextcord.Guild) -> None: """ Generates all dates relevant to the election cycle from input election start, term start and end dates. @@ -30,7 +29,7 @@ class ElectionCycle: term_end (datetime): Date the term being elected ends. bot: the discord bot instance """ - self.config: DakinyConfig = bot.config + self.config: DakinyConfig = config self.cycle = cycle self.elecion_cycle = self.config.election_cycles[self.cycle] self.election_start: datetime = get_datetime(self.elecion_cycle.election_start) @@ -41,7 +40,7 @@ class ElectionCycle: self.highcouncil_election_announce: datetime = self.voting_end + timedelta(days=1) self.highcouncil_election_start: datetime = self.highcouncil_election_announce + timedelta(days=3) self.highcouncil_election_end: datetime = self.term_start - timedelta(days=1) - self.guild: nextcord.Guild = bot.get_guild(self.config.params.guild_id) + self.guild: nextcord.Guild = guild def build_election_announcement(self) -> list[str]: """