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:
Return type:

Check[Context[Any]]

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.

Return type:

Check[Context[Any]]

discord_tools.has_attachments(*, count=...)[source]

A decorator that checks if the invoker message has any attachments.

Parameters:

count (int) – The amount of attachments the message should have for this check to pass successfully. Limit is 10.

Return type:

Check[Context[Any]]

discord_tools.has_voice_state()[source]

A decorator that checks if the command invoker has a voice state (is in a voice channel).

Return type:

Check[Context[Any]]