Md Shahriyar Alam
By utilizing the new
has_any_permission we can have conditional cooldowns in a command.
Lets say we want a 10 seconds cooldown for administrators and 1 minute cooldown for other users. We can use the
if has_permission(user, "administrator"): cooldown("10 seconds", user.id) else: cooldown("1 minutes", user.id)
Using this code in pre-hook will allow admins to use the command every 10 seconds, but other users will have a 1 minute cooldown.
If you want no cooldown for admins you can also do that easily by using the code below.
if not has_permission(user, "administrator"): cooldown("1 minutes", user.id)
This code will check if the user dont have the administrator permission, he will have 1 minute cooldown, Otherwise no cooldown.
Possibilities are endless. You just have to think. 🚀
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