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
+13 -13
View File
@@ -8,7 +8,7 @@ This clan is about human interaction, and the Clan Council positions serve to pr
We want all CMs to grow and succeed. Please, reach out for assistance and advice if you find yourself going even a few days without taking real, actionable steps towards the prosperity of Dakiny. Recruiting, hosting events, participating in the Clan Council Discord, and demonstrating the Core Elements of the position are required from each and every CM to grow a happy and healthy clan. We want all CMs to grow and succeed. Please, reach out for assistance and advice if you find yourself going even a few days without taking real, actionable steps towards the prosperity of Dakiny. Recruiting, hosting events, participating in the Clan Council Discord, and demonstrating the Core Elements of the position are required from each and every CM to grow a happy and healthy clan.
__So here's how it works:__ __So here's how it works:__
{{message_break}} ---message_break---
Each quarter, a channel is created here on Discord for clan members to cast their vote to determine the Clan Council for that 3-month period. Each quarter, a channel is created here on Discord for clan members to cast their vote to determine the Clan Council for that 3-month period.
**Only clan members can vote and all clan members are granted exactly one equally weighted vote.** If you vote twice for different people, your vote will be annulled. **Only clan members can vote and all clan members are granted exactly one equally weighted vote.** If you vote twice for different people, your vote will be annulled.
@@ -25,26 +25,26 @@ Then, the new Clan Council Elect will come together to select the 2 High Council
RuneScape 3 Clan Leader RuneScape 3 Clan Leader
Discord Server Manager Discord Server Manager
The Clan Council will be denoted by the Discord ranks of <@&{{clan_council_id}}> and <@&{{high_council_id}}> and in-game with the following ranks. The Clan Council will be denoted by the Discord ranks of <@&{clan_council_id}> and <@&{high_council_id}> and in-game with the following ranks.
<:Rank_Admin:479008185240518656> Admin <:Rank_Admin:479008185240518656> Admin
<:Rank_Organiser:479008215024009216> Organizer <:Rank_Organiser:479008215024009216> Organizer
<:Rank_Coordinator:479008238654849045> Coordinator <:Rank_Coordinator:479008238654849045> Coordinator
<:Rank_Overseer:479008269382451201> Overseer <:Rank_Overseer:479008269382451201> Overseer
<:Rank_Deputy:479008295319896064> Deputy Owner <:Rank_Deputy:479008295319896064> Deputy Owner
<:Rank_Owner:479008325137072155> Clan Leader <:Rank_Owner:479008325137072155> Clan Leader
{{message_break}} ---message_break---
__Here's the timeline:__ __Here's the timeline:__
Election begins: {{election_start_date}} Election begins: {election_start_date}
Term: {{term_start_date}} - {{term_end_date}} Term: {term_start_date} - {term_end_date}
**{{election_start_date}}**: Post here to announce candidacy **{election_start_date}**: Post here to announce candidacy
**{{voting_start_date}}**: Voting begins **{voting_start_date}**: Voting begins
**{{voting_end_date}}**: Votes are tallied and winners are announced **{voting_end_date}**: Votes are tallied and winners are announced
**{{highcouncil_election_date}}**: The new Clan Council votes who among them shall receive the two High Council positions of: Clan Leader and Discord Server Manager. **{highcouncil_election_date}**: The new Clan Council votes who among them shall receive the two High Council positions of: Clan Leader and Discord Server Manager.
**{{term_start_date}}**: The new Clan Council is officially inaugurated and a drop party (or a giveaway event) begins to commemorate the new leadership. **{term_start_date}**: The new Clan Council is officially inaugurated and a drop party (or a giveaway event) begins to commemorate the new leadership.
This process will begin again next quarter on {{next_election_start_date}} with the inauguration scheduled for {{term_end_date}}. This process will begin again next quarter on {next_election_start_date} with the inauguration scheduled for {term_end_date}.
{{message_break}} ---message_break---
**You may now announce your candidacy for a seat on the Dakiny Clan Council! **You may now announce your candidacy for a seat on the Dakiny Clan Council!
** **
You may include a speech with your announcement, as well as specific pertinent facts such as total recruits, time in the clan, past Clan Council experience, and donations made. This data is available upon request via <@&{{clan_council_id}}>. You may include a speech with your announcement, as well as specific pertinent facts such as total recruits, time in the clan, past Clan Council experience, and donations made. This data is available upon request via <@&{clan_council_id}>.
+23 -1
View File
@@ -17,7 +17,29 @@ class MessageBuilder:
self.config = config self.config = config
self.cycle = cycle 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. Builds the voting start message out of template and configurations.
+1 -1
View File
@@ -35,7 +35,7 @@ class TestCog(commands.Cog, name="Test commands."):
""" """
msg_bulder = MessageBuilder(self.bot.config, 0) msg_bulder = MessageBuilder(self.bot.config, 0)
message = msg_bulder.get_vote_start() message = msg_bulder.build_vote_start()
# doesn't tell discord that the message was responded to. Is a test command so I don't really care atm. # doesn't tell discord that the message was responded to. Is a test command so I don't really care atm.
await interaction.channel.send(content=message) await interaction.channel.send(content=message)