@gcommands/plugin-blacklist

Easy to use blacklist system

Usage no npm install needed!

<script type="module">
  import gcommandsPluginBlacklist from 'https://cdn.skypack.dev/@gcommands/plugin-blacklist';
</script>

README

GCommands Plugin Blacklist

Official plugin for GCommands


NPM Banner


Installation

Install with npm / yarn / pnpm:

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

Informations

// 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);
const { BlacklistManager } = require('@gcommands/plugin-blacklist');

BlacklistManager.setBlacklist(client, userId, true); // blacklisted
BlacklistManager.setBlacklist(client, userId, false); // unblacklisted

If you have inhibitors in command, you need add new BlacklistInhibitor();