diff --git a/classes/election_cycle.py b/classes/election_cycle.py index fdf9c63..cbc5c01 100644 --- a/classes/election_cycle.py +++ b/classes/election_cycle.py @@ -21,6 +21,7 @@ from database_setup.sql_data_classes import ( engine, ) from utils import ( + build_highcouncil_votes_str, build_votes_str, get_cl_election_name, get_datetime, @@ -304,8 +305,10 @@ class ElectionCycle: election_thread: nextcord.Thread = self.guild.get_thread( self.get_election_info().ThreadId ) + await election_thread.send(message) vote_msg = await election_thread.send( - message, view=VoteHighcouncilView(self.config, self.guild) + build_highcouncil_votes_str(self.config), + view=VoteHighcouncilView(self.config, self.guild), ) with Session(engine) as session: diff --git a/cogs/commands/test.py b/cogs/commands/test.py index ad7233a..42c8148 100644 --- a/cogs/commands/test.py +++ b/cogs/commands/test.py @@ -32,7 +32,7 @@ class TestCog(commands.Cog, name="Test commands."): """ self.bot = bot - @nextcord.slash_command() + @nextcord.slash_command(guild_ids=[1000247361639030804]) async def test(self, interaction: nextcord.Interaction): """ Parent slash command for help. Never called. diff --git a/utils.py b/utils.py index 408ebde..58804b4 100644 --- a/utils.py +++ b/utils.py @@ -154,30 +154,26 @@ def build_highcouncil_votes_str(config: DakinyConfig) -> str: with Session(engine) as session: stmt = select(CouncilMembers).where( - CouncilMembers.ElectionCycle == get_cl_election_name(config) + CouncilMembers.ElectionCycle == get_election_cycle_name(config) ) for nominee in session.scalars(stmt): cl_votes[nominee.MemberId] = 0 - stmt = select(Votes).where( - Votes.ElectionCycle == get_election_cycle_name(config) - ) + stmt = select(Votes).where(Votes.ElectionCycle == get_cl_election_name(config)) for vote in session.scalars(stmt): if vote.VotedForId is not None: cl_votes[vote.VotedForId] += 1 stmt = select(CouncilMembers).where( - CouncilMembers.ElectionCycle == get_dm_election_name(config) + CouncilMembers.ElectionCycle == get_election_cycle_name(config) ) for nominee in session.scalars(stmt): dm_votes[nominee.MemberId] = 0 - stmt = select(Votes).where( - Votes.ElectionCycle == get_election_cycle_name(config) - ) + stmt = select(Votes).where(Votes.ElectionCycle == get_dm_election_name(config)) for vote in session.scalars(stmt): if vote.VotedForId is not None: