Add cooldown on slash commands

Md Shahriyar Alam

4 days ago

If you want to control how often commands can be executed. 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

Code

Use these codes in Hooks (pre)

pycooldown("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.

Need help?

If you still need any kind of help, have a suggestion for us or having a question in mind? Feel free to reach us out.

Join support server
logoCustom Commands

#1 Custom commands discord bot available on the internet

We Accept

stripe

Contact

20-22 Wenlock RoadEnglandN1 7GU

© WEiRDSOFT LTD. All rights reserved.