Add cooldown on slash commands
Md Shahriyar Alam
2 years ago
If you want to control how often commands can be executed in Custom Commands bot. You need to use cooldowns.
To add cooldown to a command you need to cooldowns in it. To add cooldowns
to slash command you need to use the cooldown programmed variabe
Use these codes in Hooks (pre)
cooldown("1 minutes", user.id)Essentially what this code will do is, make the command cooldown for 1 minutes after last execution, so the user can't use it for next 1 minutes.
in place of user.id if you put server.id it will put this cooldown globally. Which means the cooldown is now global.
And if anyone of the server use it. It will be unavailable for other users too for next 1 minute.
Loading comments…
Have a question, a suggestion, or stuck on something? Reach out — we're happy to help.