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:
|
||||
"""
|
||||
|
||||
@@ -41,3 +41,15 @@ class TestCog(commands.Cog, name="Test commands."):
|
||||
# doesn't tell discord that the message was responded to. Is a test command so I don't really care atm.
|
||||
for m in message:
|
||||
await interaction.channel.send(content=m)
|
||||
|
||||
@test.subcommand()
|
||||
async def election_start(self, interaction: nextcord.Interaction):
|
||||
"""
|
||||
idc
|
||||
|
||||
Args:
|
||||
interaction (nextcord.Interaction): _description_
|
||||
"""
|
||||
|
||||
cycle = ElectionCycle(0, self.bot)
|
||||
await cycle.election_start_action()
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
Discord permissions required for bot to operate:
|
||||
|
||||
manage channels
|
||||
Reference in New Issue
Block a user