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
+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()