This commit is contained in:
@@ -90,6 +90,22 @@ class ElectionCycle:
|
|||||||
term_start_date=self.term_start.strftime("%B %d"),
|
term_start_date=self.term_start.strftime("%B %d"),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def build_highcouncil_vote_start(self) -> str:
|
||||||
|
"""
|
||||||
|
Builds the message to announce that highcouncil voting has started.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
str: Message to send.
|
||||||
|
"""
|
||||||
|
|
||||||
|
with open("bot_messages/highcouncil_vote.txt", mode="r", encoding="utf8") as file:
|
||||||
|
message = file.read()
|
||||||
|
|
||||||
|
return message.format(
|
||||||
|
clan_council_elect_role_id=self.config.params.clan_council_elect_role_id,
|
||||||
|
term_start_date=self.term_start.strftime("%B %d"),
|
||||||
|
)
|
||||||
|
|
||||||
def build_vote_start(self) -> str:
|
def build_vote_start(self) -> str:
|
||||||
"""
|
"""
|
||||||
Builds the voting start message out of template and configurations.
|
Builds the voting start message out of template and configurations.
|
||||||
@@ -123,7 +139,7 @@ class ElectionCycle:
|
|||||||
elif today.date() == self.voting_end.date():
|
elif today.date() == self.voting_end.date():
|
||||||
await self.voting_end_action()
|
await self.voting_end_action()
|
||||||
elif today.date() == self.highcouncil_election_start.date():
|
elif today.date() == self.highcouncil_election_start.date():
|
||||||
await self.highcouncil_election_action()
|
await self.highcouncil_election_start_action()
|
||||||
elif today.date() == self.term_start.date():
|
elif today.date() == self.term_start.date():
|
||||||
await self.term_start_action()
|
await self.term_start_action()
|
||||||
elif today.date() == self.term_end.date():
|
elif today.date() == self.term_end.date():
|
||||||
@@ -173,11 +189,14 @@ class ElectionCycle:
|
|||||||
await election_channel.send(message)
|
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)
|
||||||
|
|
||||||
async def highcouncil_election_action(self) -> None:
|
async def highcouncil_election_start_action(self) -> None:
|
||||||
"""
|
"""
|
||||||
Performs required actions for when the highcouncil is elected.
|
Performs required actions for when the highcouncil is elected.
|
||||||
"""
|
"""
|
||||||
print("Highcouncil election has started.")
|
|
||||||
|
message = self.build_highcouncil_vote_start()
|
||||||
|
election_channel = self.guild.get_channel(self.get_election_info().ElectionChannel)
|
||||||
|
await election_channel.send(message)
|
||||||
|
|
||||||
async def term_start_action(self) -> None:
|
async def term_start_action(self) -> None:
|
||||||
msg: str = "the term has started"
|
msg: str = "the term has started"
|
||||||
|
|||||||
Reference in New Issue
Block a user