Add rest of setting channel id commands.
This commit is contained in:
+2
-2
@@ -12,11 +12,11 @@ class ChannelIds:
|
|||||||
"""Class holds all channel ids needed by bot."""
|
"""Class holds all channel ids needed by bot."""
|
||||||
|
|
||||||
admin: int # might want to rename this...
|
admin: int # might want to rename this...
|
||||||
announcement_category: int
|
announcement: int
|
||||||
clan_info: int
|
clan_info: int
|
||||||
event_post: int
|
event_post: int
|
||||||
general: int
|
general: int
|
||||||
voting_parent: int
|
voting: int
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
|||||||
+1
-1
@@ -160,7 +160,7 @@ class Election:
|
|||||||
async def election_start_action(self) -> None:
|
async def election_start_action(self) -> None:
|
||||||
"""Performs required actions for when the election cycle starts."""
|
"""Performs required actions for when the election cycle starts."""
|
||||||
# create new channel for election
|
# create new channel for election
|
||||||
parent: nextcord.TextChannel = self.guild.get_channel(settings.channel_ids.voting_parent)
|
parent: nextcord.TextChannel = self.guild.get_channel(settings.channel_ids.voting)
|
||||||
quarter_name: str = get_election_name()
|
quarter_name: str = get_election_name()
|
||||||
|
|
||||||
thread_msg: nextcord.Message = await parent.send(content=quarter_name)
|
thread_msg: nextcord.Message = await parent.send(content=quarter_name)
|
||||||
|
|||||||
+103
-1
@@ -30,7 +30,7 @@ class SettingsCog(commands.Cog, name="Settings Commands"):
|
|||||||
),
|
),
|
||||||
) -> None:
|
) -> None:
|
||||||
"""
|
"""
|
||||||
Sets DakinySettings channel_ids.admin value to channel id or current channel id.
|
Sets DakinySettings channel_ids.admin value to given channel id or current channel id.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
interaction (nextcord.Interaction): Discord interaction of command.
|
interaction (nextcord.Interaction): Discord interaction of command.
|
||||||
@@ -40,3 +40,105 @@ class SettingsCog(commands.Cog, name="Settings Commands"):
|
|||||||
settings.channel_ids.admin = channel_id
|
settings.channel_ids.admin = channel_id
|
||||||
settings.save()
|
settings.save()
|
||||||
await interaction.response.send_message(f"Admin verification channel set to <#{channel_id}>.", ephemeral=True)
|
await interaction.response.send_message(f"Admin verification channel set to <#{channel_id}>.", ephemeral=True)
|
||||||
|
|
||||||
|
@channel_ids.subcommand(description="Sets announcement channel.")
|
||||||
|
async def announcement(
|
||||||
|
self,
|
||||||
|
interaction: nextcord.Interaction,
|
||||||
|
channel: nextcord.TextChannel = nextcord.SlashOption(
|
||||||
|
required=False, description="Channel to set to. If left blank, uses current channel."
|
||||||
|
),
|
||||||
|
) -> None:
|
||||||
|
"""
|
||||||
|
Sets DakinySettings channel_ids.announcement value to given channel id or current channel id.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
interaction (nextcord.Interaction): Discord interaction of command.
|
||||||
|
channel (nextcord.TextChannel, optional): Channel to set in settings.
|
||||||
|
"""
|
||||||
|
channel_id = interaction.channel_id if channel is None else channel.id
|
||||||
|
settings.channel_ids.announcement = channel_id
|
||||||
|
settings.save()
|
||||||
|
await interaction.response.send_message(f"Announcement channel set to <#{channel_id}>.", ephemeral=True)
|
||||||
|
|
||||||
|
@channel_ids.subcommand(description="Sets clan info channel. Channel used for tracking current council.")
|
||||||
|
async def clan_info(
|
||||||
|
self,
|
||||||
|
interaction: nextcord.Interaction,
|
||||||
|
channel: nextcord.TextChannel = nextcord.SlashOption(
|
||||||
|
required=False, description="Channel to set to. If left blank, uses current channel."
|
||||||
|
),
|
||||||
|
) -> None:
|
||||||
|
"""
|
||||||
|
Sets DakinySettings channel_ids.clan_info value to given channel id or current channel id.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
interaction (nextcord.Interaction): Discord interaction of command.
|
||||||
|
channel (nextcord.TextChannel, optional): Channel to set in settings.
|
||||||
|
"""
|
||||||
|
channel_id = interaction.channel_id if channel is None else channel.id
|
||||||
|
settings.channel_ids.clan_info = channel_id
|
||||||
|
settings.save()
|
||||||
|
await interaction.response.send_message(f"Clan information channel set to <#{channel_id}>.", ephemeral=True)
|
||||||
|
|
||||||
|
@channel_ids.subcommand(
|
||||||
|
description="Sets event post channel. Channel is where event tracking information is posted."
|
||||||
|
)
|
||||||
|
async def event_post(
|
||||||
|
self,
|
||||||
|
interaction: nextcord.Interaction,
|
||||||
|
channel: nextcord.TextChannel = nextcord.SlashOption(
|
||||||
|
required=False, description="Channel to set to. If left blank, uses current channel."
|
||||||
|
),
|
||||||
|
) -> None:
|
||||||
|
"""
|
||||||
|
Sets DakinySettings channel_ids.event_post value to given channel id or current channel id.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
interaction (nextcord.Interaction): Discord interaction of command.
|
||||||
|
channel (nextcord.TextChannel, optional): Channel to set in settings.
|
||||||
|
"""
|
||||||
|
channel_id = interaction.channel_id if channel is None else channel.id
|
||||||
|
settings.channel_ids.event_post = channel_id
|
||||||
|
settings.save()
|
||||||
|
await interaction.response.send_message(f"Event posting channel set to <#{channel_id}>.", ephemeral=True)
|
||||||
|
|
||||||
|
@channel_ids.subcommand(description="Sets general channel.")
|
||||||
|
async def general(
|
||||||
|
self,
|
||||||
|
interaction: nextcord.Interaction,
|
||||||
|
channel: nextcord.TextChannel = nextcord.SlashOption(
|
||||||
|
required=False, description="Channel to set to. If left blank, uses current channel."
|
||||||
|
),
|
||||||
|
) -> None:
|
||||||
|
"""
|
||||||
|
Sets DakinySettings channel_ids.general value to given channel id or current channel id.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
interaction (nextcord.Interaction): Discord interaction of command.
|
||||||
|
channel (nextcord.TextChannel, optional): Channel to set in settings.
|
||||||
|
"""
|
||||||
|
channel_id = interaction.channel_id if channel is None else channel.id
|
||||||
|
settings.channel_ids.general = channel_id
|
||||||
|
settings.save()
|
||||||
|
await interaction.response.send_message(f"General channel set to <#{channel_id}>.", ephemeral=True)
|
||||||
|
|
||||||
|
@channel_ids.subcommand(description="Sets voting channel. Channel used as parent for voting threads.")
|
||||||
|
async def voting(
|
||||||
|
self,
|
||||||
|
interaction: nextcord.Interaction,
|
||||||
|
channel: nextcord.TextChannel = nextcord.SlashOption(
|
||||||
|
required=False, description="Channel to set to. If left blank, uses current channel."
|
||||||
|
),
|
||||||
|
) -> None:
|
||||||
|
"""
|
||||||
|
Sets DakinySettings channel_ids.voting value to given channel id or current channel id.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
interaction (nextcord.Interaction): Discord interaction of command.
|
||||||
|
channel (nextcord.TextChannel, optional): Channel to set in settings.
|
||||||
|
"""
|
||||||
|
channel_id = interaction.channel_id if channel is None else channel.id
|
||||||
|
settings.channel_ids.voting = channel_id
|
||||||
|
settings.save()
|
||||||
|
await interaction.response.send_message(f"Voting channel set to <#{channel_id}>.", ephemeral=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user