Socket
Book a DemoInstallSign in
Socket

discord-blacklister

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discord-blacklister

```npm i discord-blacklister```

1.3.2
latest
npmnpm
Version published
Weekly downloads
3
50%
Maintainers
1
Weekly downloads
 
Created
Source

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)
    }
}

Support Server

Keywords

discord

FAQs

Package last updated on 13 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.