From 06e363c55abb6665b7419d25bf6216dd1c5f3330 Mon Sep 17 00:00:00 2001 From: TropiiDev Date: Sun, 16 Mar 2025 19:13:34 -0400 Subject: [PATCH] Implement a fix for giving users xp --- commands/levels.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/levels.py b/commands/levels.py index e5ae7e7..6210c17 100644 --- a/commands/levels.py +++ b/commands/levels.py @@ -150,9 +150,9 @@ class Levels(commands.Cog): @commands.has_permissions(manage_messages=True) async def give(self, interaction: discord.Interaction, user: discord.Member, xp: int): user_coll = db.accounts - user = user_coll.find_one({"_id": user.id}) + db_user = user_coll.find_one({"_id": user.id}) - if user is None: + if db_user is None: await interaction.response.send_message(f"Cannot give user {xp} XP because they have not sent a message yet.") return