mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
[Permissions] Alwaysavailable error message (#3504)
* [Permissions] Fix message for always available commands. * Changelog
This commit is contained in:
parent
d6f9ddc3af
commit
61fc00dc08
1
changelog.d/permissions/3465.issue.rst
Normal file
1
changelog.d/permissions/3465.issue.rst
Normal file
@ -0,0 +1 @@
|
||||
Fixes issue with licenseinfo not erroring out while modified with permissions setdefaultglobalrule and setdefaultserverrule.
|
||||
@ -427,6 +427,14 @@ class Permissions(commands.Cog):
|
||||
`<cog_or_command>` is the cog or command to set the default
|
||||
rule for. This is case sensitive.
|
||||
"""
|
||||
if isinstance(cog_or_command.obj, commands.commands._AlwaysAvailableCommand):
|
||||
await ctx.send(
|
||||
_(
|
||||
"This command is designated as being always available and "
|
||||
"cannot be modified by permission rules."
|
||||
)
|
||||
)
|
||||
return
|
||||
await self._set_default_rule(
|
||||
rule=cast(Optional[bool], allow_or_deny),
|
||||
cog_or_cmd=cog_or_command,
|
||||
@ -450,6 +458,14 @@ class Permissions(commands.Cog):
|
||||
`<cog_or_command>` is the cog or command to set the default
|
||||
rule for. This is case sensitive.
|
||||
"""
|
||||
if isinstance(cog_or_command.obj, commands.commands._AlwaysAvailableCommand):
|
||||
await ctx.send(
|
||||
_(
|
||||
"This command is designated as being always available and "
|
||||
"cannot be modified by permission rules."
|
||||
)
|
||||
)
|
||||
return
|
||||
await self._set_default_rule(
|
||||
rule=cast(Optional[bool], allow_or_deny), cog_or_cmd=cog_or_command, guild_id=GLOBAL
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user