aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2024-10-07 20:49:35 +0100
committerGravatar Chris Lovering <[email protected]>2024-10-07 20:49:35 +0100
commitb29ef1e9d55933a81d4be06c1086ea73a57b8907 (patch)
tree72dd8bd0984711cfc4be16c09b1275ddad5883f5
parentSpecial case Python versions ending in t for eval output (diff)
Ensure eval version buttons ascend in release date
-rw-r--r--bot/exts/utils/snekbox/_cog.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/bot/exts/utils/snekbox/_cog.py b/bot/exts/utils/snekbox/_cog.py
index 5c83f4feb..f6c201598 100644
--- a/bot/exts/utils/snekbox/_cog.py
+++ b/bot/exts/utils/snekbox/_cog.py
@@ -88,7 +88,6 @@ REDO_TIMEOUT = 30
SupportedPythonVersions = Literal["3.12", "3.13", "3.13t"]
-
class FilteredFiles(NamedTuple):
allowed: list[FileAttachment]
blocked: list[FileAttachment]
@@ -180,7 +179,9 @@ class Snekbox(Cog):
job: EvalJob,
) -> interactions.ViewWithUserAndRoleCheck:
"""Return a view that allows the user to change what version of Python their code is run on."""
- other_versions = set(get_args(SupportedPythonVersions)) - {current_python_version}
+ other_versions = list(get_args(SupportedPythonVersions))
+ other_versions.remove(current_python_version)
+
view = interactions.ViewWithUserAndRoleCheck(
allowed_users=(ctx.author.id,),
allowed_roles=MODERATION_ROLES,