$addCooldown
Adds cooldown time to an existing cooldown in effect. You can return the amount of time left in the cooldown with `{time}`.
    1.
    Will not add time to a cooldown if a cooldown is not already in effect.
    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.
1
bot.Command({
2
name: "test",
3
code: `
4
$addCooldown[60s;guild;$commandName;$guildID]
5
​
6
$guildCooldown[30s;Cooldown in effect for {time}.]
7
`
8
})
Copied!
Example 2: Adds 60 seconds of time to a $guildCooldown put in effect. If no $guildCooldown is in effect, no time will be added.
1
bot.Command({
2
name: "test",
3
code: `
4
$addCooldown[60s;guild;$commandName;$guildID]
5
`
6
})
Copied!
Example 3: Adds 60 seconds of time to the $commandCooldown put in effect in the same command.
1
bot.Command({
2
name: "test",
3
code: `
4
$addCooldown[60s;command;$commandName]
5
​
6
$commandCooldown[30s;Cooldown in effect for {time}.]
7
`
8
})
Copied!
Last modified 4mo ago
Copy link