fix: grant_role ukco converter exception
This commit is contained in:
parent
e3e9fd6f6e
commit
bd6f019890
1 changed files with 2 additions and 2 deletions
4
main.py
4
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
|
||||
|
|
Loading…
Reference in a new issue