From ece91c417e158ed259747f26f5a7a30cbef316a6 Mon Sep 17 00:00:00 2001 From: nex <53234499+EEKIM10@users.noreply.github.com> Date: Sat, 29 Oct 2022 21:22:11 +0100 Subject: [PATCH] =?UTF-8?q?"=E2=80=A6wouldn=E2=80=99t=20a=20more=20gracefu?= =?UTF-8?q?l=20error=20make=20sense=3F"=20-=20matthew?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cogs/assignments.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cogs/assignments.py b/cogs/assignments.py index c015166..a3a927c 100644 --- a/cogs/assignments.py +++ b/cogs/assignments.py @@ -375,7 +375,7 @@ class AssignmentsCog(commands.Cog): ): """Views an assignment's details""" try: - entry_id, *_ = title.split(":") + entry_id = int(title.split(":", 1)[0]) except ValueError: return await ctx.respond("\N{cross mark} Invalid Input.") assignment: Assignments = await get_or_none(Assignments, entry_id=int(entry_id)) @@ -395,7 +395,7 @@ class AssignmentsCog(commands.Cog): ): """Edits an assignment""" try: - entry_id, *_ = title.split(":") + entry_id = int(title.split(":", 1)[0]) except ValueError: return await ctx.respond("\N{cross mark} Invalid Input.") assignment: Assignments = await get_or_none(Assignments, entry_id=int(entry_id)) @@ -636,7 +636,7 @@ class AssignmentsCog(commands.Cog): ): """Edits an assignment""" try: - entry_id, *_ = title.split(":") + entry_id = int(title.split(":", 1)[0]) except ValueError: return await ctx.respond("\N{cross mark} Invalid Input.") assignment: Assignments = await get_or_none(Assignments, entry_id=int(entry_id))