mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 10:17:59 -05:00
Fix localwhitelist/localblacklist add/remove (#2531)
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user