From 8cf66351dd14c3459f88562c8c7e31c2d2c1b968 Mon Sep 17 00:00:00 2001 From: imcompiling Date: Wed, 20 Sep 2023 20:14:32 -0400 Subject: [PATCH 1/3] Allow clan members to send messages to new channel. --- classes/election_cycle.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/classes/election_cycle.py b/classes/election_cycle.py index 3468154..00649d1 100644 --- a/classes/election_cycle.py +++ b/classes/election_cycle.py @@ -155,6 +155,8 @@ class ElectionCycle: # create new entry into database. election_channel: nextcord.TextChannel = await category.create_text_channel(quarter_name) + clan_member_role: nextcord.Role = self.guild.get_role(self.config.params.clan_member_role_id) + await election_channel.set_permissions(clan_member_role, send_messages=True) with Session(engine) as session: new_cycle = ElectionInformation(ElectionCycle=quarter_name, ElectionChannel=election_channel.id) session.add(new_cycle) From 9609837b1df7fb201e0dd8a6769ae554f25ce807 Mon Sep 17 00:00:00 2001 From: imcompiling Date: Thu, 5 Oct 2023 14:24:33 -0400 Subject: [PATCH 2/3] Control user reactions in election channel. --- classes/election_cycle.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/classes/election_cycle.py b/classes/election_cycle.py index 00649d1..9ecdca5 100644 --- a/classes/election_cycle.py +++ b/classes/election_cycle.py @@ -156,7 +156,7 @@ class ElectionCycle: # create new entry into database. election_channel: nextcord.TextChannel = await category.create_text_channel(quarter_name) clan_member_role: nextcord.Role = self.guild.get_role(self.config.params.clan_member_role_id) - await election_channel.set_permissions(clan_member_role, send_messages=True) + await election_channel.set_permissions(clan_member_role, send_messages=True, add_reactions=True) with Session(engine) as session: new_cycle = ElectionInformation(ElectionCycle=quarter_name, ElectionChannel=election_channel.id) session.add(new_cycle) @@ -188,8 +188,10 @@ 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: nextcord.TextChannel = self.guild.get_channel(self.get_election_info().ElectionChannel) + clan_member_role: nextcord.Role = self.guild.get_role(self.config.params.clan_member_role_id) await election_channel.send(message) - await election_channel.set_permissions(council_elect_role, send_messages=True) + await election_channel.set_permissions(council_elect_role, send_messages=True, add_reactions=True) + await election_channel.set_permissions(clan_member_role, add_reactions=False) async def highcouncil_election_start_action(self) -> None: """ From 8ff53d9a1363e55e2ca91266d4ef346755f3a638 Mon Sep 17 00:00:00 2001 From: imcompiling Date: Thu, 5 Oct 2023 14:26:15 -0400 Subject: [PATCH 3/3] Grammar corrections. --- bot_messages/highcouncil_election.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot_messages/highcouncil_election.txt b/bot_messages/highcouncil_election.txt index b6fdeb9..51ee5e9 100644 --- a/bot_messages/highcouncil_election.txt +++ b/bot_messages/highcouncil_election.txt @@ -8,6 +8,6 @@ From {highcouncil_election_announce} to {highcouncil_election_start}, you will b Discord Server Manager Each member of the CCE can cast one for each category by using the emotes: <:Rank_Owner:479008325137072155> for Clan Leader and <:Rank_Deputy:479008295319896064> for Discord Server Manager. -If needed, the icon 🤷 can be used to abstain to vote in any or both categories and it should be apply to all candidates of that category. +If needed, the icon 🤷 can be used to abstain to vote in any or both categories and it should be applied to all candidates of that category. -Votes can be cast until the {highcouncil_election_end}, so we can announce and have everyone set up to start the term by {term_start}. \ No newline at end of file +Votes can be cast until {highcouncil_election_end}, so we can announce and have everyone set up to start the term by {term_start}. \ No newline at end of file