Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
cac620c
Bump pycord to 2.8
MattyTheHacker Aug 22, 2026
91111ad
Bump python to 3.14
MattyTheHacker Aug 22, 2026
e08ae5c
Fix prek error
MattyTheHacker Aug 22, 2026
e9f150e
Merge branch 'bump-pycord' into bump-python
MattyTheHacker Aug 22, 2026
7055885
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 22, 2026
be69a0a
Convert to use get_or_fetch everywhere
MattyTheHacker Aug 23, 2026
43faf6d
Merge main into bump-pycord
automatic-pr-updater[bot] Sep 1, 2026
2a1f0aa
Merge main into bump-python
automatic-pr-updater[bot] Sep 1, 2026
3860662
Lock file maintenance
renovate[bot] Sep 10, 2026
37195d8
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 10, 2026
f334102
Upgrade base image to Python 3.14
MattyTheHacker Sep 10, 2026
756a57c
Remove invalid pre-commit config argument
CarrotManMatt Sep 11, 2026
cf17f0e
Update dependencies and fix security recommendations
CarrotManMatt Sep 11, 2026
fc25610
Merge branch 'renovate/lock-file-maintenance-pep621' into bump-pycord
CarrotManMatt Sep 11, 2026
d1f459b
Switch to builtin prek hooks where possible
CarrotManMatt Sep 14, 2026
3196e2e
Update dependencies again
CarrotManMatt Sep 14, 2026
8dd6293
Fix link format in README.md according to PyMarkdown
CarrotManMatt Sep 14, 2026
7ebc57b
Merge remote-tracking branch 'origin/renovate/lock-file-maintenance-p…
CarrotManMatt Sep 15, 2026
b96bffd
Merge main into bump-pycord
automatic-pr-updater[bot] Sep 15, 2026
04f888d
Merge main into bump-pycord
automatic-pr-updater[bot] Sep 15, 2026
6d6aad3
Remove old TODO
MattyTheHacker Sep 15, 2026
1eb9b4b
Merge branch 'bump-pycord' into bump-python
MattyTheHacker Sep 15, 2026
6d05fe8
Merge branch 'main' into bump-pycord
MattyTheHacker Sep 15, 2026
e3f059c
Merge branch 'main' into bump-python
MattyTheHacker Sep 15, 2026
dc20ecf
Bump lock file
MattyTheHacker Sep 15, 2026
0978bdd
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 15, 2026
2c389ed
Fix errors
MattyTheHacker Sep 15, 2026
d900033
Merge branch 'bump-pycord' into bump-python
MattyTheHacker Sep 15, 2026
be3a204
Merge branch 'main' into bump-python
MattyTheHacker Sep 15, 2026
e496c13
Fix type import
MattyTheHacker Sep 15, 2026
6e41e9a
Update utils/tex_bot_contexts.py
MattyTheHacker Sep 15, 2026
c6c2f40
Fix deletion2
MattyTheHacker Sep 15, 2026
98e7e9c
Fix extra imports
MattyTheHacker Sep 15, 2026
88ed3b2
Restore pre-commit config from main
MattyTheHacker Sep 15, 2026
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
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.13
3.14
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/astral-sh/uv:python3.13-trixie-slim AS builder
FROM ghcr.io/astral-sh/uv:python3.14-trixie-slim AS builder

RUN apt-get update && \
apt-get upgrade -y && \
Expand All @@ -20,7 +20,7 @@ COPY utils/ /app/utils/
COPY db/ /app/db/
COPY cogs/ /app/cogs/

FROM python:3.13-slim-trixie
FROM python:3.14-slim-trixie

RUN groupadd --system --gid 999 nonroot && useradd --system --gid 999 --uid 999 --create-home nonroot

Expand Down
4 changes: 2 additions & 2 deletions cogs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

from utils import TeXBot, TeXBotBaseCog

__all__: "Sequence[str]" = (
__all__: Sequence[str] = (
"AddUsersToThreadsAndChannelsCommandCog",
"AnnualRolesResetCommandCog",
"AnnualYearChannelsIncrementCommandCog",
Expand Down Expand Up @@ -89,7 +89,7 @@
)


def setup(bot: "TeXBot") -> None:
def setup(bot: TeXBot) -> None:
"""Add all the cogs to the bot, at bot startup."""
cogs: Iterable[type[TeXBotBaseCog]] = (
AddUsersToThreadsAndChannelsCommandsCog,
Expand Down
18 changes: 9 additions & 9 deletions cogs/add_users_to_threads_and_channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@
from utils import TeXBotApplicationContext, TeXBotAutocompleteContext


__all__: "Sequence[str]" = ("AddUsersToThreadsAndChannelsCommandsCog",)
__all__: Sequence[str] = ("AddUsersToThreadsAndChannelsCommandsCog",)


logger: "Final[Logger]" = logging.getLogger("TeX-Bot")
logger: Final[Logger] = logging.getLogger("TeX-Bot")


class AddUsersToThreadsAndChannelsCommandsCog(TeXBotBaseCog):
"""Cog for adding users to threads."""

@staticmethod
async def autocomplete_get_members(
ctx: "TeXBotAutocompleteContext",
) -> "AbstractSet[discord.OptionChoice] | AbstractSet[str]":
ctx: TeXBotAutocompleteContext,
) -> AbstractSet[discord.OptionChoice] | AbstractSet[str]:
"""Autocomplete callable that generates the set of available selectable members."""
try:
main_guild: discord.Guild = ctx.bot.main_guild
guest_role: discord.Role = await ctx.bot.guest_role
except (GuildDoesNotExistError, GuestRoleDoesNotExistError):
except GuildDoesNotExistError, GuestRoleDoesNotExistError:
Comment thread
MattyTheHacker marked this conversation as resolved.
Resolved
return set()

members: set[discord.Member] = {
Expand All @@ -58,8 +58,8 @@ async def autocomplete_get_members(

@staticmethod
async def autocomplete_get_roles(
ctx: "TeXBotAutocompleteContext",
) -> "AbstractSet[discord.OptionChoice] | AbstractSet[str]":
ctx: TeXBotAutocompleteContext,
) -> AbstractSet[discord.OptionChoice] | AbstractSet[str]:
"""Autocomplete callable that generates the set of available selectable roles."""
try:
main_guild: discord.Guild = ctx.bot.main_guild
Expand Down Expand Up @@ -205,7 +205,7 @@ async def on_thread_create(self, thread: discord.Thread) -> None:
@CommandChecks.check_interaction_user_in_main_guild
async def add_user_to_channel(
self,
ctx: "TeXBotApplicationContext",
ctx: TeXBotApplicationContext,
user_id_str: str,
silent: bool, # noqa: FBT001
) -> None:
Expand Down Expand Up @@ -260,7 +260,7 @@ async def add_user_to_channel(
@CommandChecks.check_interaction_user_in_main_guild
async def add_role_to_channel(
self,
ctx: "TeXBotApplicationContext",
ctx: TeXBotApplicationContext,
role_id_str: str,
silent: bool, # noqa: FBT001
) -> None:
Expand Down
12 changes: 6 additions & 6 deletions cogs/annual_handover_and_reset.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

from utils import AllChannelTypes, TeXBotApplicationContext

__all__: "Sequence[str]" = (
__all__: Sequence[str] = (
"AnnualRolesResetCommandCog",
"AnnualYearChannelsIncrementCommandCog",
"CommitteeHandoverCommandCog",
)


logger: "Final[Logger]" = logging.getLogger("TeX-Bot")
logger: Final[Logger] = logging.getLogger("TeX-Bot")


class CommitteeHandoverCommandCog(TeXBotBaseCog):
Expand All @@ -36,7 +36,7 @@ class CommitteeHandoverCommandCog(TeXBotBaseCog):
)
@CommandChecks.check_interaction_user_has_committee_role
@CommandChecks.check_interaction_user_in_main_guild
async def committee_handover(self, ctx: "TeXBotApplicationContext") -> None:
async def committee_handover(self, ctx: TeXBotApplicationContext) -> None:
"""
Definition & callback response of the "committee_handover" command.

Expand Down Expand Up @@ -165,7 +165,7 @@ async def committee_handover(self, ctx: "TeXBotApplicationContext") -> None:
class AnnualRolesResetCommandCog(TeXBotBaseCog):
"""Cog class that defines the "/annual-roles-reset" command."""

ACADEMIC_YEAR_ROLE_NAMES: "Final[frozenset[str]]" = frozenset(
ACADEMIC_YEAR_ROLE_NAMES: Final[frozenset[str]] = frozenset(
{
"Foundation Year",
"First Year",
Expand All @@ -184,7 +184,7 @@ class AnnualRolesResetCommandCog(TeXBotBaseCog):
)
@CommandChecks.check_interaction_user_has_committee_role
@CommandChecks.check_interaction_user_in_main_guild
async def annual_roles_reset(self, ctx: "TeXBotApplicationContext") -> None:
async def annual_roles_reset(self, ctx: TeXBotApplicationContext) -> None:
"""
Definition & callback response of the "annual_roles_reset" command.

Expand Down Expand Up @@ -273,7 +273,7 @@ class AnnualYearChannelsIncrementCommandCog(TeXBotBaseCog):
)
@CommandChecks.check_interaction_user_has_committee_role
@CommandChecks.check_interaction_user_in_main_guild
async def increment_year_channels(self, ctx: "TeXBotApplicationContext") -> None:
async def increment_year_channels(self, ctx: TeXBotApplicationContext) -> None:
"""
Definition and callback response of the "increment_year_channels" command.

Expand Down
20 changes: 10 additions & 10 deletions cogs/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@

from utils import AllChannelTypes, TeXBotApplicationContext, TeXBotAutocompleteContext

__all__: "Sequence[str]" = ("ArchiveCommandsCog",)
__all__: Sequence[str] = ("ArchiveCommandsCog",)


logger: "Final[Logger]" = logging.getLogger("TeX-Bot")
logger: Final[Logger] = logging.getLogger("TeX-Bot")


class ArchiveCommandsCog(TeXBotBaseCog):
"""Cog class that defines the "/archive" command and its call-back method."""

@staticmethod
async def autocomplete_get_non_archival_categories(
ctx: "TeXBotAutocompleteContext",
) -> "AbstractSet[discord.OptionChoice] | AbstractSet[str]":
ctx: TeXBotAutocompleteContext,
) -> AbstractSet[discord.OptionChoice] | AbstractSet[str]:
"""
Autocomplete callable that generates the set of available selectable categories.

Expand All @@ -50,8 +50,8 @@ async def autocomplete_get_non_archival_categories(

@staticmethod
async def autocomplete_get_archival_categories(
ctx: "TeXBotAutocompleteContext",
) -> "AbstractSet[discord.OptionChoice] | AbstractSet[str]":
ctx: TeXBotAutocompleteContext,
) -> AbstractSet[discord.OptionChoice] | AbstractSet[str]:
"""
Autocomplete callable that generates the set of categories to hold archived channels.

Expand All @@ -72,8 +72,8 @@ async def autocomplete_get_archival_categories(

@staticmethod
async def autocomplete_get_non_archived_channels(
ctx: "TeXBotAutocompleteContext",
) -> "AbstractSet[discord.OptionChoice] | AbstractSet[str]":
ctx: TeXBotAutocompleteContext,
) -> AbstractSet[discord.OptionChoice] | AbstractSet[str]:
"""
Autocomplete callable that generates the set of channels that the user can archive.

Expand Down Expand Up @@ -123,7 +123,7 @@ async def autocomplete_get_non_archived_channels(
@CommandChecks.check_interaction_user_in_main_guild
async def archive_category(
self,
ctx: "TeXBotApplicationContext",
ctx: TeXBotApplicationContext,
str_category_id: str,
allow_archivist: bool, # noqa: FBT001
) -> None:
Expand Down Expand Up @@ -236,7 +236,7 @@ async def archive_category(
@CommandChecks.check_interaction_user_has_committee_role
@CommandChecks.check_interaction_user_in_main_guild
async def archive_channel(
self, ctx: "TeXBotApplicationContext", str_channel_id: str, str_category_id: str
self, ctx: TeXBotApplicationContext, str_channel_id: str, str_category_id: str
) -> None:
"""
Definition & callback response of the "archive-channel" command.
Expand Down
16 changes: 7 additions & 9 deletions cogs/check_su_platform_authorisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,17 @@

from utils import TeXBot, TeXBotApplicationContext

__all__: "Sequence[str]" = (
__all__: Sequence[str] = (
"CheckSUPlatformAuthorisationCommandCog",
"CheckSUPlatformAuthorisationTaskCog",
)


logger: "Final[Logger]" = logging.getLogger("TeX-Bot")
logger: Final[Logger] = logging.getLogger("TeX-Bot")


SU_PLATFORM_PROFILE_URL: "Final[str]" = "https://guildofstudents.com/profile"
SU_PLATFORM_ORGANISATION_URL: "Final[str]" = (
"https://www.guildofstudents.com/organisation/admin"
)
SU_PLATFORM_PROFILE_URL: Final[str] = "https://guildofstudents.com/profile"
SU_PLATFORM_ORGANISATION_URL: Final[str] = "https://www.guildofstudents.com/organisation/admin"


class SUPlatformAccessCookieStatus(Enum):
Expand Down Expand Up @@ -93,7 +91,7 @@ async def get_su_platform_access_cookie_status(self) -> SUPlatformAccessCookieSt
)
return SUPlatformAccessCookieStatus.INVALID

async def get_su_platform_organisations(self) -> "Iterable[str]":
async def get_su_platform_organisations(self) -> Iterable[str]:
"""Retrieve the MSL organisations the current SU platform cookie has access to."""
response_object: bs4.BeautifulSoup = bs4.BeautifulSoup(
await fetch_url_content_with_session(SU_PLATFORM_PROFILE_URL), "html.parser"
Expand Down Expand Up @@ -170,7 +168,7 @@ class CheckSUPlatformAuthorisationCommandCog(CheckSUPlatformAuthorisationBaseCog
)
@CommandChecks.check_interaction_user_has_committee_role
@CommandChecks.check_interaction_user_in_main_guild
async def check_su_platform_authorisation(self, ctx: "TeXBotApplicationContext") -> None:
async def check_su_platform_authorisation(self, ctx: TeXBotApplicationContext) -> None:
"""
Definition of the "check_su_platform_authorisation" command.

Expand Down Expand Up @@ -209,7 +207,7 @@ class CheckSUPlatformAuthorisationTaskCog(CheckSUPlatformAuthorisationBaseCog):
"""Cog class defining a repeated task for checking SU platform access cookie."""

@override
def __init__(self, bot: "TeXBot") -> None:
def __init__(self, bot: TeXBot) -> None:
"""Start all task managers when this cog is initialised."""
if settings["AUTO_SU_PLATFORM_ACCESS_COOKIE_CHECKING"]:
_ = self.su_platform_access_cookie_check_task.start()
Expand Down
6 changes: 3 additions & 3 deletions cogs/command_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@

from utils import TeXBotApplicationContext

__all__: "Sequence[str]" = ("CommandErrorCog",)
__all__: Sequence[str] = ("CommandErrorCog",)


logger: "Final[Logger]" = logging.getLogger("TeX-Bot")
logger: Final[Logger] = logging.getLogger("TeX-Bot")


class CommandErrorCog(TeXBotBaseCog):
"""Cog class that defines additional code to execute upon a command error."""

@TeXBotBaseCog.listener()
async def on_application_command_error(
self, ctx: "TeXBotApplicationContext", error: discord.ApplicationCommandError
self, ctx: TeXBotApplicationContext, error: discord.ApplicationCommandError
) -> None:
"""Log any major command errors in the logging channel & stderr."""
error_code: str | None = None
Expand Down
Loading