Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions cogs/annual_handover_and_reset.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

if TYPE_CHECKING:
from collections.abc import Collection, Mapping, Sequence
from collections.abc import Set as AbstractSet
from logging import Logger
from typing import Final

Expand Down Expand Up @@ -290,6 +291,30 @@ async def increment_year_channels(self, ctx: TeXBotApplicationContext) -> None:
f'{ctx.user} used TeX-Bot slash-command: "/increment-year-channels"'
)

MODULE_THREAD_NAMES: Final[AbstractSet[str]] = {
"Advanced Cryptography",
"Advanced Functional Programming (AFP)",
"Advanced Networking",
"Algorithms and Complexity",
"Computer Vision and Imaging",
"Computer-Aided Verification",
"Dependable and Distributed Systems",
"Evolutionary Computation",
"Game Theory",
"High Performance Computing",
"Intelligent Data Analysis",
"Intelligent Interactive Systems",
"Intelligent Robotics",
"Intelligent Software Engineering",
"Machine Learning",
"Mobile and Ubiquitous Computing",
"Natural Language Processing",
"Neural Computation",
"PLPDI",
"Security of Real-World Systems",
"Teaching Computer Science in Schools",
}

async with ctx.typing():
initial_message: discord.Interaction | discord.WebhookMessage = await ctx.respond(
content=":hourglass: Incrementing year channels... :hourglass:"
Expand Down Expand Up @@ -340,6 +365,16 @@ async def increment_year_channels(self, ctx: TeXBotApplicationContext) -> None:
topic="Channel for final-years to chat and ask questions.",
reason=INCREMENT_YEAR_CHANNELS_AUDIT_MESSAGE,
)
for thread in MODULE_THREAD_NAMES:
thread_channel: discord.TextChannel | None = discord.utils.get(
main_guild.text_channels, name=thread
)
if not thread_channel:
await second_years_channel.create_thread(
name=thread,
type=discord.ChannelType.public_thread,
reason=INCREMENT_YEAR_CHANNELS_AUDIT_MESSAGE,
)

first_year_channel: discord.TextChannel | None = discord.utils.get(
main_guild.text_channels, name="first-years"
Expand Down
Loading