CommandCooldowns

Manages command cooldowns for players or other command senders.

This object stores cooldown timestamps for each command and checks whether a user is on cooldown for a particular command. It uses a ConcurrentHashMap to store cooldown data, ensuring thread safety for commands executed asynchronously.

Functions

Link copied to clipboard
fun isOnCooldown(key: String, delay: Long): Boolean

Checks if the given key is currently on cooldown.

Link copied to clipboard

Puts the given key on cooldown by recording the current time.