Start working on highcouncl election start message.
build

This commit is contained in:
2023-07-02 11:29:23 -04:00
parent edc7722f76
commit 9914d77d52
2 changed files with 31 additions and 3 deletions
+13
View File
@@ -0,0 +1,13 @@
`Leadership Elections - candidacy time`
<@&{clan_council_elect_role_id}>, welcome. We are starting the second part of our elections. On {highcouncil_election_announce} this channel will be open to write for all of you. Everyone else will be able to read this channel, but not write in it. Only members of the Clan Council Elected (CCE) can vote now. Any votes from others will be annulled.
From {highcouncil_election_announce} to {highcouncil_election_start}, you will be able to announce your candidacy for High Council. The positions are:
Clan Leader
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.
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}
+18 -3
View File
@@ -35,7 +35,9 @@ class ElectionCycle:
self.term_end: datetime = get_datetime(self.elecion_cycle.term_end)
self.voting_start: datetime = get_datetime(self.elecion_cycle.voting_start)
self.voting_end: datetime = get_datetime(self.elecion_cycle.voting_end)
self.highcouncil_election: datetime = self.voting_end + timedelta(days=1)
self.highcouncil_election_announce: datetime = self.voting_end + timedelta(days=1)
self.highcouncil_election_start: datetime = self.highcouncil_election_announce + timedelta(days=3)
self.highcouncil_election_end: datetime = self.term_start - timedelta(days=1)
self.bot: commands.Bot = bot
def build_election_announcement(self) -> list[str]:
@@ -59,12 +61,25 @@ class ElectionCycle:
term_end_date=self.term_end.strftime("%B %d"),
voting_start_date=self.voting_start.strftime("%B %d"),
voting_end_date=self.voting_end.strftime("%B %d"),
highcouncil_election_date=self.highcouncil_election.strftime("%B %d"),
highcouncil_election_date=self.highcouncil_election_start.strftime("%B %d"),
next_election_start_date=next_election.strftime("%B %d"),
)
return message.split("---message_break---")
def build_highcouncil_election(self) -> str:
"""
Builds message to announce highcouncil election start.
Returns:
str: Message to send.
"""
with open("bot_messages/highcouncil_election.txt", mode="r", encoding="utf8") as file:
message = file.read()
return message.format()
def build_vote_start(self) -> str:
"""
Builds the voting start message out of template and configurations.
@@ -98,7 +113,7 @@ class ElectionCycle:
await self.voting_end_action()
elif today.date() == self.voting_end.date():
await self.voting_end_action()
elif today.date() == self.highcouncil_election.date():
elif today.date() == self.highcouncil_election_start.date():
await self.highcouncil_election_action()
elif today.date() == self.term_start.date():
await self.term_start_action()