Remove config param from get_current_election_cycle(). Update test.py to use new settings.
This commit is contained in:
+15
-27
@@ -1,17 +1,12 @@
|
||||
"""Commands for testing."""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import nextcord
|
||||
from nextcord.ext import application_checks, commands
|
||||
|
||||
from classes.election import Election
|
||||
from DakinySettings import settings
|
||||
from utils import GUILDS, get_current_election_cycle
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from DakinySettings import DakinySettings
|
||||
|
||||
|
||||
ME = 206602713511886849
|
||||
|
||||
|
||||
@@ -44,10 +39,9 @@ class TestCog(commands.Cog, name="Test commands."):
|
||||
Args:
|
||||
interaction (nextcord.Interaction): Interaction with the message.
|
||||
"""
|
||||
config: DakinySettings = self.bot.config
|
||||
cycle = Election(
|
||||
get_current_election_cycle(config),
|
||||
self.bot.get_guild(config.params.guild_id),
|
||||
get_current_election_cycle(),
|
||||
self.bot.get_guild(settings.params.guild_id),
|
||||
)
|
||||
await cycle.election_start_action()
|
||||
await interaction.send("Test command sent.", ephemeral=True)
|
||||
@@ -61,10 +55,9 @@ class TestCog(commands.Cog, name="Test commands."):
|
||||
Args:
|
||||
interaction (nextcord.Interaction): Interaction with the message.
|
||||
"""
|
||||
config: DakinySettings = self.bot.config
|
||||
cycle = Election(
|
||||
get_current_election_cycle(config),
|
||||
self.bot.get_guild(config.params.guild_id),
|
||||
get_current_election_cycle(),
|
||||
self.bot.get_guild(settings.params.guild_id),
|
||||
)
|
||||
await cycle.voting_start_action()
|
||||
await interaction.send("Test command sent.", ephemeral=True)
|
||||
@@ -78,10 +71,9 @@ class TestCog(commands.Cog, name="Test commands."):
|
||||
Args:
|
||||
interaction (nextcord.Interaction): Interaction with the message.
|
||||
"""
|
||||
config: DakinySettings = self.bot.config
|
||||
cycle = Election(
|
||||
get_current_election_cycle(config),
|
||||
self.bot.get_guild(config.params.guild_id),
|
||||
get_current_election_cycle(),
|
||||
self.bot.get_guild(settings.params.guild_id),
|
||||
)
|
||||
await cycle.voting_end_action()
|
||||
await interaction.send("Test command sent.", ephemeral=True)
|
||||
@@ -95,10 +87,9 @@ class TestCog(commands.Cog, name="Test commands."):
|
||||
Args:
|
||||
interaction (nextcord.Interaction): Interaction with the message.
|
||||
"""
|
||||
config: DakinySettings = self.bot.config
|
||||
cycle = Election(
|
||||
get_current_election_cycle(config),
|
||||
self.bot.get_guild(config.params.guild_id),
|
||||
get_current_election_cycle(),
|
||||
self.bot.get_guild(settings.params.guild_id),
|
||||
)
|
||||
await cycle.highcouncil_election_start_action()
|
||||
await interaction.send("Test command sent.", ephemeral=True)
|
||||
@@ -112,10 +103,9 @@ class TestCog(commands.Cog, name="Test commands."):
|
||||
Args:
|
||||
interaction (nextcord.Interaction): Interaction with the message.
|
||||
"""
|
||||
config: DakinySettings = self.bot.config
|
||||
cycle = Election(
|
||||
get_current_election_cycle(config),
|
||||
self.bot.get_guild(config.params.guild_id),
|
||||
get_current_election_cycle(),
|
||||
self.bot.get_guild(settings.params.guild_id),
|
||||
)
|
||||
await cycle.election_reminder()
|
||||
await interaction.send("Test command sent.", ephemeral=True)
|
||||
@@ -129,10 +119,9 @@ class TestCog(commands.Cog, name="Test commands."):
|
||||
Args:
|
||||
interaction (nextcord.Interaction): Interaction with the message.
|
||||
"""
|
||||
config: DakinySettings = self.bot.config
|
||||
cycle = Election(
|
||||
get_current_election_cycle(config),
|
||||
self.bot.get_guild(config.params.guild_id),
|
||||
get_current_election_cycle(),
|
||||
self.bot.get_guild(settings.params.guild_id),
|
||||
)
|
||||
await cycle.check_date()
|
||||
await interaction.send("Test command sent.", ephemeral=True)
|
||||
@@ -146,10 +135,9 @@ class TestCog(commands.Cog, name="Test commands."):
|
||||
Args:
|
||||
interaction (nextcord.Interaction): Interaction with the message.
|
||||
"""
|
||||
config: DakinySettings = self.bot.config
|
||||
cycle = Election(
|
||||
get_current_election_cycle(config),
|
||||
self.bot.get_guild(config.params.guild_id),
|
||||
get_current_election_cycle(),
|
||||
self.bot.get_guild(settings.params.guild_id),
|
||||
)
|
||||
await cycle.term_start_action()
|
||||
await interaction.send("Test command sent.", ephemeral=True)
|
||||
|
||||
Reference in New Issue
Block a user