Start working on election announcement builder.
build

This commit is contained in:
2023-07-01 23:22:17 -04:00
parent abd9be6341
commit 9f3b625cd2
3 changed files with 37 additions and 15 deletions
+23 -1
View File
@@ -17,7 +17,29 @@ class MessageBuilder:
self.config = config
self.cycle = cycle
def get_vote_start(self) -> str:
def build_election_announcement(self) -> list[str]:
"""
Builds the messages to announce the election is starting.
Returns:
list[str]: A list of message contents in the correct order.
"""
with open("bot_messages/election_announcement.txt", mode="r", encoding="utf8") as file:
message = file.read()
election_start: datetime = get_datetime(self.config.election_cycles[self.cycle].election_start)
term_start: datetime = get_datetime(self.config.election_cycles[self.cycle].term_start)
message = message.format(
clan_council_id=self.config.params.clan_council_role_id,
high_council_id=self.config.params.high_council_role_id,
election_start_date=election_start.strftime("%B %d"),
term_start_date=term_start.strftime("%B %d"),
)
# TODO make sure to split the message on message break.
def build_vote_start(self) -> str:
"""
Builds the voting start message out of template and configurations.