Updated files in classes directory to use new configs. Ensured usages are updated.

This commit is contained in:
2024-09-03 15:57:50 -04:00
parent 2244765d87
commit 3b289e74c8
8 changed files with 78 additions and 109 deletions
-7
View File
@@ -47,7 +47,6 @@ class TestCog(commands.Cog, name="Test commands."):
config: DakinySettings = self.bot.config
cycle = Election(
get_current_election_cycle(config),
config,
self.bot.get_guild(config.params.guild_id),
)
await cycle.election_start_action()
@@ -65,7 +64,6 @@ class TestCog(commands.Cog, name="Test commands."):
config: DakinySettings = self.bot.config
cycle = Election(
get_current_election_cycle(config),
config,
self.bot.get_guild(config.params.guild_id),
)
await cycle.voting_start_action()
@@ -83,7 +81,6 @@ class TestCog(commands.Cog, name="Test commands."):
config: DakinySettings = self.bot.config
cycle = Election(
get_current_election_cycle(config),
config,
self.bot.get_guild(config.params.guild_id),
)
await cycle.voting_end_action()
@@ -101,7 +98,6 @@ class TestCog(commands.Cog, name="Test commands."):
config: DakinySettings = self.bot.config
cycle = Election(
get_current_election_cycle(config),
config,
self.bot.get_guild(config.params.guild_id),
)
await cycle.highcouncil_election_start_action()
@@ -119,7 +115,6 @@ class TestCog(commands.Cog, name="Test commands."):
config: DakinySettings = self.bot.config
cycle = Election(
get_current_election_cycle(config),
config,
self.bot.get_guild(config.params.guild_id),
)
await cycle.election_reminder()
@@ -137,7 +132,6 @@ class TestCog(commands.Cog, name="Test commands."):
config: DakinySettings = self.bot.config
cycle = Election(
get_current_election_cycle(config),
config,
self.bot.get_guild(config.params.guild_id),
)
await cycle.check_date()
@@ -155,7 +149,6 @@ class TestCog(commands.Cog, name="Test commands."):
config: DakinySettings = self.bot.config
cycle = Election(
get_current_election_cycle(config),
config,
self.bot.get_guild(config.params.guild_id),
)
await cycle.term_start_action()
+3 -5
View File
@@ -10,6 +10,7 @@ from sqlalchemy import select
from sqlalchemy.orm import Session
from classes.election import Election
from DakinySettings import settings
from database_setup.sql_data_classes import UserBirthday, engine
from main import birthday_list
from utils import get_current_election_cycle
@@ -17,8 +18,6 @@ from utils import get_current_election_cycle
if TYPE_CHECKING:
import nextcord
from DakinySettings import DakinySettings
KANDY = 239547993106284544
@@ -76,14 +75,13 @@ class DailyLoop(commands.Cog, name="Daily Loop"):
Returns:
Election: Current election cycle, None if there is no election happening.
"""
config: DakinySettings = self.bot.config
cycle = get_current_election_cycle(config)
cycle = get_current_election_cycle(settings)
# prevent exception from using cycle as an Int in an array
if cycle is None:
return None
return Election(cycle, config, self.bot.get_guild(config.params.guild_id))
return Election(cycle, self.bot.get_guild(settings.params.guild_id))
def update_birthdays(self) -> None:
"""Goes through database to collect all birthdays that are today. Adds user's id to birthday list."""