ghostdevv / jellycommands

A command handler for Discord.js
https://jellycommands.dev
Other
20 stars 5 forks source link

Cooldown system for commands #203

Open ardentkilnfire opened 4 months ago

ardentkilnfire commented 4 months ago

Describe the feature

commands should have property cooldown. and an array containing all the commands should be exposed somehow (cause i am sure it (the array containing all the commands) is being used internally to register the commands), so that we can use that to loop over commands and check if they have cooldown & if they have , then we can create our own cooldown system in the interactionCreate event. Or you can provide a internal cooldown system (in that case, no need to expose all commands array)

Examples


export default command({
    cooldown: 5000,  // 5000 milliseconds
    run: ({ interaction, client, props }) => {
        // Do something
    }
})```
ardentkilnfire commented 4 months ago

or cooldown thing can be moved to guards