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:
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.

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.

discord_tools.has_voice_state()[source]

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