Cooldowns & Limits
To ensure fair usage and prevent abuse, Discord implements rate limits on its API. Our bot also uses a cooldown system to manage requests efficiently. This page explains how these limits work and how they might affect your custom commands.
What are Cooldowns and Limits
Cooldowns and limits are restirictions, that control how frequently certain actions can be performed.
- Cooldown: A waiting period before a function can be used again.
- Limit: A maximum number of times a function can be called within single execution.
Function Cooldowns
Many functions have a built-in cooldown period. This means that after using the function, there will be a delay before it can be used again.
Functions have cooldown types. Different functions with the same cooldown type must wait.
Cooldowns are also per something. For example, if the cooldown is per user, only the user who executed the function will get cooldown.
Cooldown Behavior
When you hit a cooldown, the bot's behavior depends on the function:
- Wait on cooldown: The bot waits for the cooldown to expire and then executes the function.
- Cancel the execution on cooldown with error message: The bot sends an error message indicating that the function is on cooldown. Code will stop executing and will not continue.
Function Limits
Some functions can only be called a limited number of times within a single execution.
A function with cooldown can be called a maximum of 5 times in one execution.
If this limit is reached, the bot will silently cancel the execution of the function.
Execution Limits
These limits control how many custom commands can run simultaneously and how quickly they can be triggered.
- Parallel Executions: The bot supports up to 5 parallel executions of the same custom command.
- Command Cooldown: The same custom command can only be triggered once every 5 seconds per user.
Tier 3+ Limits
- Function Cooldowns: Removed entirely.
- Function Limits: Hard capped to 20 calls per custom command.
- Parallel Executions: Hard capped to 60 parallel executions.
- Command Cooldown: Hard capped to 0.5 seconds.
See ccommandbot.com/perks for more informations.