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
tools.app_commands.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.disabledattribute toTrueafter the limit is exhausted. Defaults toFalse. Only allowed ifbucketisdiscord.ext.commands.BucketType.default.
- Return type:
- 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.