1.3.2 • Published 3 years ago

discord-blacklister v1.3.2

Weekly downloads
8
License
MIT
Repository
-
Last release
3 years ago

Installation

npm i discord-blacklister

Usage

Use this package to simply stop specific users from using your bot commands! Install now!!

Methods

Make sure you have a config.json in your main/root folder

Set

const discordblacklister = require('discord-blacklister')
module.exports = {
    name: 'blacklist',
    callback: (message) => {
        await discordblacklister.Set(message.mentions.users.first().id)
        message.reply('Blacklisted')
    }
}

Read

In the Message event(Make sure that you check the message if the command was correct just above the part where u run it with callback run or execute)

const discordblacklister = require('discord-blacklister')
<client>.on(message, (message) => {
    const args = message.content.slice(newPrefix.length).trim().split(/ +/g);
    const cmd = args.shift().toLowerCase();

  if (cmd.length === 0) return;
  const command = <client>.commands.get(cmd) || <client>.aliases.get(cmd)


  if (command) {
let ans = (message.author.id !== "bot owner")?await blaclister.Read(message): false
    if(ans == true) {   // This one aswell
return message.channel.send('You have been blacklisted') // This is  whatever you wanna do if the person is blacklisted
    }
    else {
        command.run(message, args)
    }
})

Remove

const discordblacklister = require('discord-blacklister')
module.exports = {
    name: 'blacklist',
    callback: (message) => {
        await discordblacklister.Remove(message)
    }
}

Links

Support Server

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago