mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
[Core] Tell user that the (local) whitelist/blacklist is empty when using a list command. (#3219)
* Update core_commands.py * Create 3219.bugfix.rst
This commit is contained in:
parent
60a1b3294d
commit
75c4bee8a3
1
changelog.d/3219.bugfix.rst
Normal file
1
changelog.d/3219.bugfix.rst
Normal file
@ -0,0 +1 @@
|
||||
Tell user that the (local) whitelist/blacklist is empty when using commands that list whitelisted/blacklisted users/roles.
|
||||
@ -1705,6 +1705,10 @@ class Core(commands.Cog, CoreLogic):
|
||||
"""
|
||||
curr_list = await ctx.bot._config.whitelist()
|
||||
|
||||
if not curr_list:
|
||||
await ctx.send("Whitelist is empty.")
|
||||
return
|
||||
|
||||
msg = _("Whitelisted Users:")
|
||||
for user in curr_list:
|
||||
msg += "\n\t- {}".format(user)
|
||||
@ -1768,6 +1772,10 @@ class Core(commands.Cog, CoreLogic):
|
||||
"""
|
||||
curr_list = await ctx.bot._config.blacklist()
|
||||
|
||||
if not curr_list:
|
||||
await ctx.send("Blacklist is empty.")
|
||||
return
|
||||
|
||||
msg = _("Blacklisted Users:")
|
||||
for user in curr_list:
|
||||
msg += "\n\t- {}".format(user)
|
||||
@ -1838,6 +1846,10 @@ class Core(commands.Cog, CoreLogic):
|
||||
"""
|
||||
curr_list = await ctx.bot._config.guild(ctx.guild).whitelist()
|
||||
|
||||
if not curr_list:
|
||||
await ctx.send("Local whitelist is empty.")
|
||||
return
|
||||
|
||||
msg = _("Whitelisted Users and roles:")
|
||||
for obj in curr_list:
|
||||
msg += "\n\t- {}".format(obj)
|
||||
@ -1923,6 +1935,10 @@ class Core(commands.Cog, CoreLogic):
|
||||
"""
|
||||
curr_list = await ctx.bot._config.guild(ctx.guild).blacklist()
|
||||
|
||||
if not curr_list:
|
||||
await ctx.send("Local blacklist is empty.")
|
||||
return
|
||||
|
||||
msg = _("Blacklisted Users and Roles:")
|
||||
for obj in curr_list:
|
||||
msg += "\n\t- {}".format(obj)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user