Add active parameter to elections. Only return an election for use if the election is active.
This commit is contained in:
@@ -5,7 +5,7 @@ from nextcord.ext import application_checks, commands
|
||||
|
||||
from classes.election import Election
|
||||
from DakinySettings import settings
|
||||
from utils import GUILDS, get_current_election_cycle
|
||||
from utils import GUILDS, get_active_election_cycle
|
||||
|
||||
ME = 206602713511886849
|
||||
|
||||
@@ -40,7 +40,7 @@ class TestCog(commands.Cog, name="Test commands."):
|
||||
interaction (nextcord.Interaction): Interaction with the message.
|
||||
"""
|
||||
cycle = Election(
|
||||
get_current_election_cycle(),
|
||||
get_active_election_cycle(),
|
||||
self.bot.get_guild(settings.params.guild_id),
|
||||
)
|
||||
await cycle.election_start_action()
|
||||
@@ -56,7 +56,7 @@ class TestCog(commands.Cog, name="Test commands."):
|
||||
interaction (nextcord.Interaction): Interaction with the message.
|
||||
"""
|
||||
cycle = Election(
|
||||
get_current_election_cycle(),
|
||||
get_active_election_cycle(),
|
||||
self.bot.get_guild(settings.params.guild_id),
|
||||
)
|
||||
await cycle.voting_start_action()
|
||||
@@ -72,7 +72,7 @@ class TestCog(commands.Cog, name="Test commands."):
|
||||
interaction (nextcord.Interaction): Interaction with the message.
|
||||
"""
|
||||
cycle = Election(
|
||||
get_current_election_cycle(),
|
||||
get_active_election_cycle(),
|
||||
self.bot.get_guild(settings.params.guild_id),
|
||||
)
|
||||
await cycle.voting_end_action()
|
||||
@@ -88,7 +88,7 @@ class TestCog(commands.Cog, name="Test commands."):
|
||||
interaction (nextcord.Interaction): Interaction with the message.
|
||||
"""
|
||||
cycle = Election(
|
||||
get_current_election_cycle(),
|
||||
get_active_election_cycle(),
|
||||
self.bot.get_guild(settings.params.guild_id),
|
||||
)
|
||||
await cycle.highcouncil_election_start_action()
|
||||
@@ -104,7 +104,7 @@ class TestCog(commands.Cog, name="Test commands."):
|
||||
interaction (nextcord.Interaction): Interaction with the message.
|
||||
"""
|
||||
cycle = Election(
|
||||
get_current_election_cycle(),
|
||||
get_active_election_cycle(),
|
||||
self.bot.get_guild(settings.params.guild_id),
|
||||
)
|
||||
await cycle.election_reminder()
|
||||
@@ -120,7 +120,7 @@ class TestCog(commands.Cog, name="Test commands."):
|
||||
interaction (nextcord.Interaction): Interaction with the message.
|
||||
"""
|
||||
cycle = Election(
|
||||
get_current_election_cycle(),
|
||||
get_active_election_cycle(),
|
||||
self.bot.get_guild(settings.params.guild_id),
|
||||
)
|
||||
await cycle.check_date()
|
||||
@@ -136,7 +136,7 @@ class TestCog(commands.Cog, name="Test commands."):
|
||||
interaction (nextcord.Interaction): Interaction with the message.
|
||||
"""
|
||||
cycle = Election(
|
||||
get_current_election_cycle(),
|
||||
get_active_election_cycle(),
|
||||
self.bot.get_guild(settings.params.guild_id),
|
||||
)
|
||||
await cycle.term_start_action()
|
||||
|
||||
Reference in New Issue
Block a user