From d79c990558427a1f67e3ca06b7fa8c36454af827 Mon Sep 17 00:00:00 2001 From: imcompiling Date: Tue, 25 Jul 2023 15:11:33 -0400 Subject: [PATCH 1/2] Remove term end action. --- classes/election_cycle.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/classes/election_cycle.py b/classes/election_cycle.py index 2f5a888..f1a9822 100644 --- a/classes/election_cycle.py +++ b/classes/election_cycle.py @@ -142,8 +142,6 @@ class ElectionCycle: await self.highcouncil_election_start_action() elif today.date() == self.term_start.date(): await self.term_start_action() - elif today.date() == self.term_end.date(): - await self.term_end_action() async def election_start_action(self) -> None: """ @@ -202,10 +200,6 @@ class ElectionCycle: msg: str = "the term has started" print(msg) - async def term_end_action(self): - msg: str = "the term has ended" - print(msg) - def get_election_cycle_name(self) -> str: """ Builds the unique name of the current election cycle From 0eae8afa2a828b3c5b5b78c11f2bbe3be0a03e4e Mon Sep 17 00:00:00 2001 From: imcompiling Date: Tue, 25 Jul 2023 15:25:35 -0400 Subject: [PATCH 2/2] Fill out term_start_action --- classes/election_cycle.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/classes/election_cycle.py b/classes/election_cycle.py index f1a9822..c2e4a60 100644 --- a/classes/election_cycle.py +++ b/classes/election_cycle.py @@ -152,7 +152,7 @@ class ElectionCycle: quarter_name: str = self.get_election_cycle_name() # create new entry into database. - election_channel = await category.create_text_channel(quarter_name) + election_channel: nextcord.TextChannel = await category.create_text_channel(quarter_name) with Session(engine) as session: new_cycle = ElectionInformation(ElectionCycle=quarter_name, ElectionChannel=election_channel.id) session.add(new_cycle) @@ -173,7 +173,7 @@ class ElectionCycle: """ message = self.build_vote_start() clan_member_role: nextcord.Role = self.guild.get_role(self.config.params.clan_member_role_id) - election_channel = self.guild.get_channel(self.get_election_info().ElectionChannel) + election_channel: nextcord.TextChannel = self.guild.get_channel(self.get_election_info().ElectionChannel) await election_channel.send(message) await election_channel.set_permissions(clan_member_role, send_messages=False) @@ -183,7 +183,7 @@ class ElectionCycle: """ message = self.build_highcouncil_election_announce() council_elect_role: nextcord.Role = self.guild.get_role(self.config.params.clan_council_elect_role_id) - election_channel = self.guild.get_channel(self.get_election_info().ElectionChannel) + election_channel: nextcord.TextChannel = self.guild.get_channel(self.get_election_info().ElectionChannel) await election_channel.send(message) await election_channel.set_permissions(council_elect_role, send_messages=True) @@ -193,12 +193,17 @@ class ElectionCycle: """ message = self.build_highcouncil_vote_start() - election_channel = self.guild.get_channel(self.get_election_info().ElectionChannel) + election_channel: nextcord.TextChannel = self.guild.get_channel(self.get_election_info().ElectionChannel) await election_channel.send(message) async def term_start_action(self) -> None: - msg: str = "the term has started" - print(msg) + """ + Moves the election channel into the archive category. + """ + election_channel: nextcord.TextChannel = self.guild.get_channel(self.get_election_info().ElectionChannel) + archive: nextcord.CategoryChannel = self.guild.get_channel(self.config.params.archive_channel_group_id) + + await election_channel.move(beginning=True, category=archive) def get_election_cycle_name(self) -> str: """