Command Check Decorators
The following are all decorators for commands, which add restrictions to where and when they can be run.
- redbot.core.commands.admin()[source]
Restrict the command to users with the admin role.
This check can be overridden by rules.
- redbot.core.commands.admin_or_can_manage_channel(*, allow_thread_owner=False)[source]
Restrict the command to users with the admin role or permissions to manage channel.
This check properly resolves the permissions for
discord.Thread
as well.This check can be overridden by rules.
- Parameters:
allow_thread_owner (bool) – If
True
, the command will also be allowed to run if the author is a thread owner. This can, for example, be useful to check if the author can edit a channel/thread’s name as that, in addition to members with manage channel/threads permission, can also be done by the thread owner.
- redbot.core.commands.admin_or_permissions(**perms)[source]
Restrict the command to users with the admin role or these permissions.
This check can be overridden by rules.
- redbot.core.commands.bot_can_manage_channel(*, allow_thread_owner=False)[source]
Complain if the bot is missing permissions to manage channel.
This check properly resolves the permissions for
discord.Thread
as well.- Parameters:
allow_thread_owner (bool) – If
True
, the command will also be allowed to run if the bot is a thread owner. This can, for example, be useful to check if the bot can edit a channel/thread’s name as that, in addition to members with manage channel/threads permission, can also be done by the thread owner.
- redbot.core.commands.bot_can_react()[source]
Complain if the bot is missing permissions to react.
This check properly resolves the permissions for
discord.Thread
as well.
- redbot.core.commands.bot_has_permissions(**perms)[source]
Complain if the bot is missing permissions.
If the user tries to run the command, but the bot is missing the permissions, it will send a message describing which permissions are missing.
This check cannot be overridden by rules.
- redbot.core.commands.can_manage_channel(*, allow_thread_owner=False)[source]
Restrict the command to users with permissions to manage channel.
This check properly resolves the permissions for
discord.Thread
as well.This check can be overridden by rules.
- Parameters:
allow_thread_owner (bool) – If
True
, the command will also be allowed to run if the author is a thread owner. This can, for example, be useful to check if the author can edit a channel/thread’s name as that, in addition to members with manage channel/threads permission, can also be done by the thread owner.
- redbot.core.commands.guildowner()[source]
Restrict the command to the guild owner.
This check can be overridden by rules.
- redbot.core.commands.guildowner_or_can_manage_channel(*, allow_thread_owner=False)[source]
Restrict the command to the guild owner or user with permissions to manage channel.
This check properly resolves the permissions for
discord.Thread
as well.This check can be overridden by rules.
- Parameters:
allow_thread_owner (bool) – If
True
, the command will also be allowed to run if the author is a thread owner. This can, for example, be useful to check if the author can edit a channel/thread’s name as that, in addition to members with manage channel/threads permission, can also be done by the thread owner.
- redbot.core.commands.guildowner_or_permissions(**perms)[source]
Restrict the command to the guild owner or users with these permissions.
This check can be overridden by rules.
- redbot.core.commands.has_guild_permissions(**perms)[source]
Restrict the command to users with these guild permissions.
This check can be overridden by rules.
- redbot.core.commands.has_permissions(**perms)[source]
Restrict the command to users with these permissions.
This check can be overridden by rules.
- redbot.core.commands.is_owner()[source]
Restrict the command to bot owners.
This check cannot be overridden by rules.
- redbot.core.commands.mod()[source]
Restrict the command to users with the mod role.
This check can be overridden by rules.
- redbot.core.commands.mod_or_can_manage_channel(*, allow_thread_owner=False)[source]
Restrict the command to users with the mod role or permissions to manage channel.
This check properly resolves the permissions for
discord.Thread
as well.This check can be overridden by rules.
- Parameters:
allow_thread_owner (bool) – If
True
, the command will also be allowed to run if the author is a thread owner. This can, for example, be useful to check if the author can edit a channel/thread’s name as that, in addition to members with manage channel/threads permission, can also be done by the thread owner.
- redbot.core.commands.mod_or_permissions(**perms)[source]
Restrict the command to users with the mod role or these permissions.
This check can be overridden by rules.
- redbot.core.commands.permissions_check(predicate)[source]
An overwriteable version of
discord.ext.commands.check
.This has the same behaviour as
discord.ext.commands.check
, however this check can be ignored if the command is allowed through a permissions cog.