From 431e9c0b353f921ce916b275d5f711c39c64228f Mon Sep 17 00:00:00 2001 From: imcompiling Date: Wed, 8 Nov 2023 16:11:47 -0500 Subject: [PATCH] Filled out term start action. --- classes/election_cycle.py | 10 ++++++++++ cogs/commands/test.py | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/classes/election_cycle.py b/classes/election_cycle.py index 7a7fafb..3197891 100644 --- a/classes/election_cycle.py +++ b/classes/election_cycle.py @@ -300,6 +300,16 @@ class ElectionCycle: self.election_over = True + election_thread: nextcord.Thread = self.guild.get_thread( + self.get_election_info().ThreadId + ) + + await election_thread.send( + "This election cycle is now over. Thank you everyone for participating!" + ) + + await election_thread.edit(archived=True, locked=True) + def get_election_info(self) -> ElectionInformation: """ Gets information for current election. diff --git a/cogs/commands/test.py b/cogs/commands/test.py index 2ee737d..8d91434 100644 --- a/cogs/commands/test.py +++ b/cogs/commands/test.py @@ -35,6 +35,7 @@ class TestCog(commands.Cog, name="Test commands."): """ @test.subcommand() + @is_me() async def msg_builder(self, interaction: nextcord.Interaction): """ Tests the message builder. @@ -52,6 +53,7 @@ class TestCog(commands.Cog, name="Test commands."): await interaction.channel.send(content=m) @test.subcommand() + @is_me() async def election_start(self, interaction: nextcord.Interaction): """ idc @@ -69,6 +71,7 @@ class TestCog(commands.Cog, name="Test commands."): await cycle.election_start_action() @test.subcommand() + @is_me() async def voting_start(self, interaction: nextcord.Interaction): """ tests the voting start action @@ -85,6 +88,7 @@ class TestCog(commands.Cog, name="Test commands."): await cycle.voting_start_action() @test.subcommand() + @is_me() async def voting_end(self, interaction: nextcord.Interaction): """ tests the voting start action @@ -101,6 +105,7 @@ class TestCog(commands.Cog, name="Test commands."): await cycle.voting_end_action() @test.subcommand() + @is_me() async def election_reminder(self, interaction: nextcord.Interaction): config: DakinyConfig = self.bot.config cycle = ElectionCycle( @@ -111,6 +116,7 @@ class TestCog(commands.Cog, name="Test commands."): await cycle.election_reminder() @test.subcommand() + @is_me() async def daily(self, interaction: nextcord.Interaction): config: DakinyConfig = self.bot.config cycle = ElectionCycle( @@ -121,6 +127,7 @@ class TestCog(commands.Cog, name="Test commands."): await cycle.check_date() @test.subcommand() + @is_me() async def term_start(self, interaction: nextcord.Interaction): config: DakinyConfig = self.bot.config cycle = ElectionCycle(