Enumerations¶
The following section outlines all the enumerations available.
BucketType¶
- class discord_tools.app_commands.BucketType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Specifies a type of bucket for, e.g. a cooldown.
This works in a similar way as
discord.ext.commands.BucketType, but designed for interactions.To pass a BucketType to a application commands cooldown you must do the following:
@app_commands.command(...) @app_commands.checks.cooldown(rate, per, key=BucketType.default) # Change the bucket type as desired async def my_command(...): ...
- default = 0¶
The default bucket operates on a global basis.
- user = 1¶
The user bucket operates on a per-user basis.
- guild = 2¶
The guild bucket operates on a per-guild basis.
- channel = 3¶
The channel bucket operates on a per-channel basis.
- member = 4¶
The member bucket operates on a per-member basis.
- category = 5¶
The category bucket operates on a per-category basis.
- role = 6¶
The role bucket operates on a per-role basis.