$serverCooldown

Sets a cooldown in a command for the whole server.

Usage

$serverCooldown[time;error message]
  1. time - (Optional) default value: 5s. The cooldown duration. Example times: 10s, 1m, 2h, 1d
  2. error message - (Optional) default value: (none). The message to send if a cooldown is still in progress.

Example

Using $serverCooldown

As you can see, first time it will set the cooldown and execute code below, second time, it won't allow execution

User06/01/2026
!!exec $serverCooldown[5m;You're on cooldown!]
You're not on cooldown!
Custom Command Bot 06/01/2026
You're not on cooldown!
User06/01/2026
!!exec $serverCooldown[5m;You're on cooldown! Still %mins%m remaining!]
You're not on cooldown!
Custom Command Bot 06/01/2026
You're on cooldown! Still 4m remaining!

Placeholders

Available placeholders you can use in error message

PlaceholderDescriptionOutput Example
%time%The full time remaining1 day 2 hours 3 minutes and 4 seconds
%days%The number of days remaining1
%hrs%The number of hours remaining2
%mins%The number of minutes remaining3
%secs%The number of seconds remaining4
%timestamp%Timestamp of cooldown expiration in seconds1735689600
%relative%Shows Discord relative timestamp (Automatically Updates)<t:1735689600:R> - Displays: in 1 day

Warning

Place this function above the code you want to use cooldown for. All code before this function will be executed.

Suggestion

You can send embeds, select menus and buttons by using the message curl format.

Function Difficulty: Easy
Tags: Cooldown Server Cooldown Limit