@gcommands/plugin-cooldowns
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.3 • Public • Published

    GCommands Plugin Cooldowns

    Official plugin for GCommands


    NPM Banner


    Installation

    Install with npm / yarn / pnpm:

    npm install @gcommands/plugin-cooldowns
    yarn add @gcommands/plugin-cooldowns
    pnpm add @gcommands/plugin-cooldowns

    Informations

    Yes, GCommands already includes built-in support for cooldowns, but only for short periods like 10 seconds, 1 minute. This plugin is used for cooldown for more than an hour, a day because it is stored in the database.

    // index.js / LruCache Provider (recommended)
    const { Plugins, GClient } = require('gcommands');
    const { MongoDBProvider } = require('gcommands/dist/providers/MongoDBProvider');
    
    const client = new GClient({
        database: new MongoDBProvider(process.env.mongodb_uri);
    })
    
    Plugins.search(__dirname);
    
    // command.js
    const { Command } = require('gcommands');
    const { CooldownInhibitor } = require('@gcommands/plugin-cooldowns');
    
    new Command({
        inhibitors: [
            new CooldownInhibitor({
                cooldown: '1d',
                message: 'You need wait {duration} before use.'
            })
        ]
        ...params
    })

    Install

    npm i @gcommands/plugin-cooldowns

    DownloadsWeekly Downloads

    48

    Version

    1.0.3

    License

    ISC

    Unpacked Size

    8.12 kB

    Total Files

    8

    Last publish

    Collaborators

    • xhyrom