Checks¶
This section outlines all the available checks.
Note
These checks are for prefixed commands only.
- discord_tools.max_usages(limit, bucket, *, hide_after_limit=False, disable_after_limit=False)[source]¶
A decorator that adds a limit of usages to a command.
This decorator is for prefixed commands only, for an application commands version see
max_usages().- Parameters:
limit (
int) – The amount of allowed usages before the command is no longer usable.bucket (
discord.ext.commands.BucketType) – The bucket in which the usages are restricted by.hide_after_limit (
bool) – Whether to set thediscord.ext.commands.Command.hiddenattribute toTrueafter the limit is exhausted. Defaults toFalse. Only allowed ifbucketisdiscord.ext.commands.BucketType.default.disable_after_limit (
bool) – Whether to set thediscord.ext.commands.Command.enabledattribute toFalseafter the limit is exhausted. Defaults toFalse. Only allowed ifbucketisdiscord.ext.commands.BucketType.default.
- discord_tools.guilds(*guild_ids)[source]¶
A decorator that adds a guild checks to a command.
This makes the command only available in the provided guilds.
This decorator is for prefixed commands only, for an application commands version see
discord.app_commands.guilds().- Parameters:
*guild_ids (Union[
discord.abc.Snowflake,int]) – The guilds to limit the command to.
- discord_tools.has_any_permissions(**perms)[source]¶
A decorator that adds a permissions check.
Unlike
discord.ext.commands.has_permissions(),discord.ext.commands.has_guild_permissions()this checks if the command invoker has any of the provided permissions.- Parameters:
**perms (
bool) – The permissions to check for.