mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
[Core] Add plural forms in allowlist and blocklist commands (#4705)
* Plurial for blocklist/allowlist * duh * Apply suggestions from code review Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
parent
8dbabe24e0
commit
7630e24822
@ -2791,8 +2791,10 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic):
|
||||
"""
|
||||
uids = {getattr(user, "id", user) for user in users}
|
||||
await self.bot._whiteblacklist_cache.add_to_whitelist(None, uids)
|
||||
|
||||
await ctx.send(_("Users added to allowlist."))
|
||||
if len(users) > 1:
|
||||
await ctx.send(_("Users has been added to the allowlist."))
|
||||
else:
|
||||
await ctx.send(_("User has been added to the allowlist."))
|
||||
|
||||
@allowlist.command(name="list")
|
||||
async def allowlist_list(self, ctx: commands.Context):
|
||||
@ -2804,8 +2806,10 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic):
|
||||
if not curr_list:
|
||||
await ctx.send("Allowlist is empty.")
|
||||
return
|
||||
|
||||
msg = _("Users on allowlist:")
|
||||
if len(curr_list) > 1:
|
||||
msg = _("Users on the allowlist:")
|
||||
else:
|
||||
msg = _("User on the allowlist:")
|
||||
for user in curr_list:
|
||||
msg += "\n\t- {}".format(user)
|
||||
|
||||
@ -2819,8 +2823,10 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic):
|
||||
"""
|
||||
uids = {getattr(user, "id", user) for user in users}
|
||||
await self.bot._whiteblacklist_cache.remove_from_whitelist(None, uids)
|
||||
|
||||
if len(users) > 1:
|
||||
await ctx.send(_("Users have been removed from the allowlist."))
|
||||
else:
|
||||
await ctx.send(_("User has been removed from the allowlist."))
|
||||
|
||||
@allowlist.command(name="clear")
|
||||
async def allowlist_clear(self, ctx: commands.Context):
|
||||
@ -2854,8 +2860,10 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic):
|
||||
|
||||
uids = {getattr(user, "id", user) for user in users}
|
||||
await self.bot._whiteblacklist_cache.add_to_blacklist(None, uids)
|
||||
|
||||
await ctx.send(_("User added to blocklist."))
|
||||
if len(users) > 1:
|
||||
await ctx.send(_("Users have been added to the blocklist."))
|
||||
else:
|
||||
await ctx.send(_("User has been added to the blocklist."))
|
||||
|
||||
@blocklist.command(name="list")
|
||||
async def blocklist_list(self, ctx: commands.Context):
|
||||
@ -2867,8 +2875,10 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic):
|
||||
if not curr_list:
|
||||
await ctx.send("Blocklist is empty.")
|
||||
return
|
||||
|
||||
msg = _("Users on blocklist:")
|
||||
if len(curr_list) > 1:
|
||||
msg = _("Users on the blocklist:")
|
||||
else:
|
||||
msg = _("User on the blocklist:")
|
||||
for user in curr_list:
|
||||
msg += "\n\t- {}".format(user)
|
||||
|
||||
@ -2882,8 +2892,10 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic):
|
||||
"""
|
||||
uids = {getattr(user, "id", user) for user in users}
|
||||
await self.bot._whiteblacklist_cache.remove_from_blacklist(None, uids)
|
||||
|
||||
await ctx.send(_("Users have been removed from blocklist."))
|
||||
if len(users) > 1:
|
||||
await ctx.send(_("Users have been removed from the blocklist."))
|
||||
else:
|
||||
await ctx.send(_("User has been removed from the blocklist."))
|
||||
|
||||
@blocklist.command(name="clear")
|
||||
async def blocklist_clear(self, ctx: commands.Context):
|
||||
@ -2937,8 +2949,10 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic):
|
||||
if not curr_list:
|
||||
await ctx.send("Server allowlist is empty.")
|
||||
return
|
||||
|
||||
msg = _("Whitelisted Users and roles:")
|
||||
if len(curr_list) > 1:
|
||||
msg = _("Allowed users and/or roles:")
|
||||
else:
|
||||
msg = _("Allowed user or role:")
|
||||
for obj in curr_list:
|
||||
msg += "\n\t- {}".format(obj)
|
||||
|
||||
@ -3024,8 +3038,10 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic):
|
||||
if not curr_list:
|
||||
await ctx.send("Server blocklist is empty.")
|
||||
return
|
||||
|
||||
msg = _("Blacklisted Users and Roles:")
|
||||
if len(curr_list) > 1:
|
||||
msg = _("Blocked users and/or roles:")
|
||||
else:
|
||||
msg = _("Blocked user or role:")
|
||||
for obj in curr_list:
|
||||
msg += "\n\t- {}".format(obj)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user