Skip to main content

$globalCooldown

This function sets a cooldown to the current command and user.

Parameters

FieldDescription
timeThe time of cooldown
errorThe error to be displayed when cooldown is active (optional)

Error Options

  • %fullTime% - Returns time in human readable duration.
  • %hours% - Returns time in hour.
  • %minutes% - Returns time in minutes.
  • %seconds% - Returns time in seconds.
  • %ms% - Returns time in milliseconds.
  • %days% - Returns time in days.
  • %weeks% - Returns time in weeks.
  • %months% - Returns time in months.
  • %years% - Returns time in years.

Examples

bot.command({
name: "hello",
code: `
$globalCooldown[1m;Hey, you need to wait %fullTime%!]
$replyMessage[Hello!]
`,
});