[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:
jack1142 2019-12-27 23:07:43 +01:00 committed by Michael H
parent 60a1b3294d
commit 75c4bee8a3
2 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1 @@
Tell user that the (local) whitelist/blacklist is empty when using commands that list whitelisted/blacklisted users/roles.

View File

@ -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)