Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

discordblacklist

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discordblacklist

A nodejs package that facilitates getting banned Discord users from DiscordBans

  • 1.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

Image

--Text Version--

discordblacklist

A nodejs package that facilitates getting banned Discord users from DiscordBans

Installing via NPM.

$ npm install discordblacklist

Setup and functions.

Creating the object:

const Blacklist = require('discordblacklist'),
banlist = new Blacklist('token');

Get a token here.

The object will try to update its banlist on creation, however you can update the list manually at any time.



To update the ban list manually: banlist.update();

This returns promise, and you can get the ban list from it with either the thenable or banlist.list.

It is recommended you update your ban list every two hours

You can have the blacklist autoupdate the list like so:

const banlist = new Blacklist('token', true, 2*60);

To specify your own auto-update interval, create your object like so:

new Blacklist('token', true, minutes);

Clearing and resetting your auto-updater

To clear the autoupdater simply call banlist.stopUpdateTimer();. To then set a new one do banlist.setUpdateTimer(minutes).

Looking up users.

banlist.lookup("id") where id is the userid of the user you want to check. This returns a boolean depending on if the user is on the ban list.

Changing token

If for whatever reason you would like to switch tokens mid-execution, you can do that easily by calling banlist.changeToken('newtoken');

Summary example:

//Create the object (which autorefreshes the banlist every 120 minutes)
const Blacklist = require('discordblacklist');
let banlist = new Blacklist('token', true, 120);

//Someone's id to test
const someID = '1234567890';

//Check if they are on the banlist
let isOnTheBanList = banlist.lookup(someID);

//Get the full list
console.log(banlist.list);

Keywords

FAQs

Package last updated on 17 Jun 2017

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc