From 982a4bb0568e2139362a4a9e93be171fe839e7de Mon Sep 17 00:00:00 2001 From: stijndcl Date: Fri, 11 Mar 2022 14:16:02 +0100 Subject: [PATCH] Remove unnecessary variables --- cogs/slash/school_slash.py | 1 - functions/utils.py | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/cogs/slash/school_slash.py b/cogs/slash/school_slash.py index b4e2325..5464dee 100644 --- a/cogs/slash/school_slash.py +++ b/cogs/slash/school_slash.py @@ -107,7 +107,6 @@ class SchoolSlash(commands.Cog): with open("files/compbio_benchmarks_2.json", "w") as fp: file[submission] = ctx.user.id - json.dump(file, fp) return await ctx.respond(f"✅ Submission **{submission}** is aan jouw naam gelinkt.", ephemeral=True) diff --git a/functions/utils.py b/functions/utils.py index 39e01d5..9aaaa64 100644 --- a/functions/utils.py +++ b/functions/utils.py @@ -26,12 +26,10 @@ def get_member_or_user(ctx: Union[ApplicationContext, Context], user_id: int) -> return member # Try to fetch the user - user = ctx.bot.get_user(user_id) - return user + return ctx.bot.get_user(user_id) # Guild exists, use that instead - mem = ctx.guild.get_member(user_id) - return mem + return ctx.guild.get_member(user_id) def get_display_name(ctx: Union[ApplicationContext, Context], user_id: int) -> str: