From bd6f01989015774f509d8c1673369f3d1c98b5b8 Mon Sep 17 00:00:00 2001 From: Lukas Nedbalek Date: Sat, 28 Sep 2024 11:40:28 +0200 Subject: [PATCH] fix: grant_role ukco converter exception --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 87db849..b93a549 100644 --- a/main.py +++ b/main.py @@ -49,7 +49,7 @@ async def on_ready(): @bot.command() -async def grant_role(ctx, study_group_name: str, ukco: int): +async def grant_role(ctx, study_group_name: str, ukco: str): """ Grant a role to the user based on the study group and UKCO. :param ctx: The context of the command. @@ -63,7 +63,7 @@ async def grant_role(ctx, study_group_name: str, ukco: int): return # Check UKCO format - if not (1000_0000 < ukco < 9999_9999): + if not ukco.isdigit() or not len(ukco) == 8: await reply_error(ctx, 'Invalid UKCO format.') await reply(ctx, HELP_MESSAGE) return