mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-06 09:22:31 -05:00
* Check if it has a privilege level
* Let's fix this in warnings too
(cherry picked from commit 5e527cb27d)
Co-authored-by: aleclol <50505980+aleclol@users.noreply.github.com>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
Co-authored-by: aleclol <50505980+aleclol@users.noreply.github.com>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
@@ -4418,9 +4418,10 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic):
|
||||
)
|
||||
return
|
||||
|
||||
if command.requires.privilege_level > await PrivilegeLevel.from_ctx(ctx):
|
||||
await ctx.send(_("You are not allowed to disable that command."))
|
||||
return
|
||||
if command.requires.privilege_level is not None:
|
||||
if command.requires.privilege_level > await PrivilegeLevel.from_ctx(ctx):
|
||||
await ctx.send(_("You are not allowed to disable that command."))
|
||||
return
|
||||
|
||||
async with ctx.bot._config.guild(ctx.guild).disabled_commands() as disabled_commands:
|
||||
if command.qualified_name not in disabled_commands:
|
||||
@@ -4489,9 +4490,10 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic):
|
||||
**Arguments:**
|
||||
- `<command>` - The command to enable for the current server.
|
||||
"""
|
||||
if command.requires.privilege_level > await PrivilegeLevel.from_ctx(ctx):
|
||||
await ctx.send(_("You are not allowed to enable that command."))
|
||||
return
|
||||
if command.requires.privilege_level is not None:
|
||||
if command.requires.privilege_level > await PrivilegeLevel.from_ctx(ctx):
|
||||
await ctx.send(_("You are not allowed to enable that command."))
|
||||
return
|
||||
|
||||
async with ctx.bot._config.guild(ctx.guild).disabled_commands() as disabled_commands:
|
||||
with contextlib.suppress(ValueError):
|
||||
|
||||
Reference in New Issue
Block a user