mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-05 17:02:32 -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)
|
user = isinstance(user_or_role, discord.Member)
|
||||||
async with ctx.bot.db.guild(ctx.guild).whitelist() as curr_list:
|
async with ctx.bot.db.guild(ctx.guild).whitelist() as curr_list:
|
||||||
if obj.id not in curr_list:
|
if user_or_role.id not in curr_list:
|
||||||
curr_list.append(obj.id)
|
curr_list.append(user_or_role.id)
|
||||||
|
|
||||||
if user:
|
if user:
|
||||||
await ctx.send(_("User added to whitelist."))
|
await ctx.send(_("User added to whitelist."))
|
||||||
@@ -1524,9 +1524,9 @@ class Core(commands.Cog, CoreLogic):
|
|||||||
|
|
||||||
removed = False
|
removed = False
|
||||||
async with ctx.bot.db.guild(ctx.guild).whitelist() as curr_list:
|
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
|
removed = True
|
||||||
curr_list.remove(obj.id)
|
curr_list.remove(user_or_role.id)
|
||||||
|
|
||||||
if removed:
|
if removed:
|
||||||
if user:
|
if user:
|
||||||
@@ -1570,8 +1570,8 @@ class Core(commands.Cog, CoreLogic):
|
|||||||
return
|
return
|
||||||
|
|
||||||
async with ctx.bot.db.guild(ctx.guild).blacklist() as curr_list:
|
async with ctx.bot.db.guild(ctx.guild).blacklist() as curr_list:
|
||||||
if obj.id not in curr_list:
|
if user_or_role.id not in curr_list:
|
||||||
curr_list.append(obj.id)
|
curr_list.append(user_or_role.id)
|
||||||
|
|
||||||
if user:
|
if user:
|
||||||
await ctx.send(_("User added to blacklist."))
|
await ctx.send(_("User added to blacklist."))
|
||||||
@@ -1603,9 +1603,9 @@ class Core(commands.Cog, CoreLogic):
|
|||||||
user = isinstance(user_or_role, discord.Member)
|
user = isinstance(user_or_role, discord.Member)
|
||||||
|
|
||||||
async with ctx.bot.db.guild(ctx.guild).blacklist() as curr_list:
|
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
|
removed = True
|
||||||
curr_list.remove(obj.id)
|
curr_list.remove(user_or_role.id)
|
||||||
|
|
||||||
if removed:
|
if removed:
|
||||||
if user:
|
if user:
|
||||||
|
|||||||
Reference in New Issue
Block a user