fix: grant_role ukco converter exception

This commit is contained in:
Lukáš Nedbálek 2024-09-28 11:40:28 +02:00
parent e3e9fd6f6e
commit bd6f019890

View file

@ -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