Flushed out election start. Added a file to track what permissions the bot needs.
This commit is contained in:
@@ -45,7 +45,8 @@ class ElectionCycle:
|
||||
Builds the messages to announce the election is starting.
|
||||
|
||||
Returns:
|
||||
list[str]: A list of message contents in the correct order.
|
||||
list[str]: A list of message contents in the correct order. Must be a string because the message is too
|
||||
long.
|
||||
"""
|
||||
|
||||
with open("bot_messages/election_announcement.txt", mode="r", encoding="utf8") as file:
|
||||
@@ -128,8 +129,19 @@ class ElectionCycle:
|
||||
Performs required actions for when the election cycle starts.
|
||||
"""
|
||||
print("election cycle has started")
|
||||
await self.message_me("election cycle has started")
|
||||
# TODO get message, input variables, split into multiple messages, send to correct channel.
|
||||
# create new channel for election
|
||||
category: nextcord.CategoryChannel = self.bot.get_channel(self.config.params.active_category_id)
|
||||
quarter_name: str = str(datetime.today().year) + "-" + self.elecion_cycle.name + "-election"
|
||||
# TODO need to store this id in the sqlite database
|
||||
election_channel = await category.create_text_channel(quarter_name)
|
||||
|
||||
# post message announcing election
|
||||
# election start message is returned as an array of string because it is too long. send each string
|
||||
# individually.
|
||||
messages = self.build_election_announcement()
|
||||
|
||||
for message in messages:
|
||||
await election_channel.send(message)
|
||||
|
||||
async def voting_start_action(self) -> None:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user