From 466b2b82d05b5aecab88a0ed6071b7987c2dca2e Mon Sep 17 00:00:00 2001 From: Michael H Date: Tue, 2 Apr 2019 22:46:12 -0400 Subject: [PATCH] Fix localwhitelist/localblacklist add/remove (#2531) --- redbot/core/core_commands.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/redbot/core/core_commands.py b/redbot/core/core_commands.py index b67226889..4d5d46c89 100644 --- a/redbot/core/core_commands.py +++ b/redbot/core/core_commands.py @@ -1491,8 +1491,8 @@ class Core(commands.Cog, CoreLogic): """ user = isinstance(user_or_role, discord.Member) async with ctx.bot.db.guild(ctx.guild).whitelist() as curr_list: - if obj.id not in curr_list: - curr_list.append(obj.id) + if user_or_role.id not in curr_list: + curr_list.append(user_or_role.id) if user: await ctx.send(_("User added to whitelist.")) @@ -1524,9 +1524,9 @@ class Core(commands.Cog, CoreLogic): removed = False async with ctx.bot.db.guild(ctx.guild).whitelist() as curr_list: - if obj.id in curr_list: + if user_or_role.id in curr_list: removed = True - curr_list.remove(obj.id) + curr_list.remove(user_or_role.id) if removed: if user: @@ -1570,8 +1570,8 @@ class Core(commands.Cog, CoreLogic): return async with ctx.bot.db.guild(ctx.guild).blacklist() as curr_list: - if obj.id not in curr_list: - curr_list.append(obj.id) + if user_or_role.id not in curr_list: + curr_list.append(user_or_role.id) if user: await ctx.send(_("User added to blacklist.")) @@ -1603,9 +1603,9 @@ class Core(commands.Cog, CoreLogic): user = isinstance(user_or_role, discord.Member) async with ctx.bot.db.guild(ctx.guild).blacklist() as curr_list: - if obj.id in curr_list: + if user_or_role.id in curr_list: removed = True - curr_list.remove(obj.id) + curr_list.remove(user_or_role.id) if removed: if user: