$addCooldown
Adds cooldown time to an existing cooldown in effect. You can return the amount of time left in the cooldown with `{time}`.
  1. 1.
    Will not add time to a cooldown if a cooldown is not already in effect.
  2. 2.
    Will not alert if no cooldown is in effect.

FUNCTION USAGE

  • $addCooldown[time;type;command]
  • $addCooldown[time;type;command;id]

Properties:

time - The amount of time to add to the cooldown. type - The type of cooldown to add time to. command - The command to associate the cooldown with. id - The ID associated with the cooldown. For affecting specific guilds, users or channels.

Types:

  • command > Used for $commandCooldown
  • user > Used for $cooldown
  • guild > Used for $guildCooldown
  • category > Used for $categoryCooldown
  • global > Used for $globalCooldown
  • channel > Used for $channelCooldown
Example 1: Adds 60 seconds of time to the $guildCooldown put in effect in the same command.
bot.Command({
name: "test",
code: `
$addCooldown[60s;guild;$commandName;$guildID]
$guildCooldown[30s;Cooldown in effect for {time}.]
`
})
Example 2: Adds 60 seconds of time to a $guildCooldown put in effect. If no $guildCooldown is in effect, no time will be added.
bot.Command({
name: "test",
code: `
$addCooldown[60s;guild;$commandName;$guildID]
`
})
Example 3: Adds 60 seconds of time to the $commandCooldown put in effect in the same command.
bot.Command({
name: "test",
code: `
$addCooldown[60s;command;$commandName]
$commandCooldown[30s;Cooldown in effect for {time}.]
`
})
Copy link