-
Notifications
You must be signed in to change notification settings - Fork 0
Cooldown Basics
Cooldowns can either be from specific commands or global if you set a global cooldown
- onCooldown
Boolean
: If the command is on cooldown or not for the user - cooldownType
String
: Either "commandCooldown" if the cooldown is from a command or "globalCooldown" if the cooldown is global - cooldown
Object
: Info about the cooldown
- data
Set
: Where users on cooldown are stored - active
Boolean
: If the cooldown is active or not - time
Number
: How long the cooldown is in seconds - relative
String
: A relative unix timestamp for the cooldown time - raw
Number
: A raw unix timestamp for the cooldown time - handle
Function
: Adds users to the cooldown - fetch
Function
: Checks if a user is on cooldown or not
{
onCooldown: Boolean, // if the command is on cooldown
cooldownType: String, // type of cooldown
cooldown: {
data: Set, // stores the users on cooldown
active: Boolean, // if the cooldown is active
time: Number, // how long the cooldown is
relative: String, // relative unix timestamp
raw: Number, // raw unix timestamp
handle: Function, // handler
fetch: Function // fetcher
},
}
global cooldowns are cooldowns that apply to all commands that don't already have cooldowns
// command has no cooldown
wc.command("a", action)
// command has a cooldown so the global cooldown isn't applied
wc.command({ name: "b", cooldown: "10s"}, action)
// sets the global cooldown to 5 seconds
wc.setCooldown("5s")
command cooldown
wc.command( {name: "ping", cooldown: "5s"}, async (ctx, cmd) => {
if (cmd.onCooldown) {
return ctx.reply(`You can use this command again in ${cmd.cooldown.relative}`);
}
ctx.reply("Ping! Command is not on cooldown!");
});
global cooldown
wc.setCooldown("5s")
For a look at some examples check out the examples folder
If anything with the mod is updated you can look to the releases for info on it
For a look into the development check out the index.js file
This mod is not associated with the creators of Discord, Discord.JS, or Discord.PY this was created out of love for Discord bot development because I wanted to make things easier for people. I do not condone harassment of the original developers and or anyone else involved in the creation of them.
I am not responsible for anything made with this mod and be sure to follow Discord's terms of service and their community guildlines while developing.
Basics
wc.command()
wc.slashCommand()
wc.commandList
wc.slashCommandList
Basics
wc.event()
wc.eventList
wc.commandAction()
wc.buttonAction()
wc.selectionAction()
wc.rowAction()
wc.fetchMessage()
wc.fetchReply()
wc.fetchUser()
wc.fetchGuildUser()
wc.fetchChannel()
wc.fetchGuildChannel()
wc.fetchRole()
wc.fetchGuildRole()
wc.fetchGuild()
wc.parseEmoji()
wc.parseSticker()