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 - npm Package Compare versions

Comparing version 2.0.0-rc to 2.0.0

.travis.yml

3

conf.json

@@ -11,3 +11,4 @@ {

"node_modules",
"docs"
"docs",
"examples"
]

@@ -14,0 +15,0 @@ },

@@ -120,3 +120,24 @@ 'use strict';

}
/**
* Compares the serializable values of Bannedusers.
* @instance
* @memberof BannedUser
* @method equals
* @param {BannedUser} other - The other BannedUser
* @return {boolean} True if other user contains the same data.
*/
equals(other) {
if (!other || !(other instanceof this.constructor)) return false;
const thisData = this.serialize(false);
const { id, tag, banID, bannedFor, proofLink } = other.serialize(false);
return (
id === thisData.id &&
tag === thisData.tag &&
banID === thisData.banID &&
bannedFor === thisData.bannedFor &&
proofLink === thisData.proofLink
);
}
/**

@@ -123,0 +144,0 @@ * Getter for <BannedUser>.serialize(). If previously cached, returns the cached object,

@@ -26,3 +26,2 @@ 'use strict';

const BanStore = class BanStore extends Map {
/**

@@ -32,8 +31,9 @@ * Constructor - Creates a BanStore

* @constructor
* @param {Array} users - The BannedUsers to initialize the BanStore with
* @param {boolean} [json=false] - Whether to use JSON for stringifying or loading data
* @param {(string|Array)} users - A string or Array containing the BannedUsers to initialize the BanStore with.
* @param {boolean} [json=false] - Whether to use JSON for stringifying or loading data.
*/
constructor(users, json = false) {
super(users ? users.map(u => [u.banID, u]) : []);
super();
this.json = !erlpack || json;
this.load(users);
}

@@ -54,3 +54,3 @@

load(obj = null, json = (!erlpack || this.json)) {
if (!obj) throw new Error('Nothing given to load');
if (!obj) return this;
let array = obj;

@@ -57,0 +57,0 @@ if (typeof array === 'string') {

@@ -89,3 +89,3 @@ 'use strict';

_fetch(token = _tokens.get(this)) {
return new Promise(async (res, rej) => {
return new Promise(async(res, rej) => {
if (!token || token === '') return rej(new TokenError('No token'));

@@ -92,0 +92,0 @@

{
"name": "discordblacklist",
"version": "2.0.0-rc",
"version": "2.0.0",
"description": "The Featured Nodejs package that facilitates getting banned Discord users from DiscordBans",

@@ -8,3 +8,6 @@ "main": "index.js",

"clean-nodem": "rm -rf ./node_modules",
"test": "node index.js",
"test": "npm run lint; npm run generictest",
"generictest": "node ./tests/generic/generaltest",
"lint": "eslint lib examples *.js",
"lint-fix": "eslint lib examples *.js --fix",
"gen-doc": "jsdoc -r --verbose -d ./docs -c ./conf.json . ./README.md;",

@@ -37,4 +40,5 @@ "clean-doc": "rm -rf ./docs; npm run gen-doc",

"devDependencies": {
"eslint": "^4.0.0",
"jsdoc-strip-async-await": "^0.1.0"
}
}

@@ -0,1 +1,14 @@

<div align="center">
<br />
<p>
<a href="https://www.npmjs.com/package/discordblacklist"><img src="https://img.shields.io/npm/v/discordblacklist.svg" alt="NPM version" /></a>
<a href="https://www.npmjs.com/package/discordblacklist"><img src="https://img.shields.io/npm/dt/discordblacklist.svg" alt="NPM downloads" /></a>
<a href="https://travis-ci.org/wzhouwzhou/discordblacklist"><img src="https://travis-ci.org/wzhouwzhou/discordblacklist.svg" alt="Build Status" /></a>
<a href="https://david-dm.org/wzhouwzhou/discordblacklist"><img src="https://img.shields.io/david/wzhouwzhou/discordblacklist.svg" alt="Dependencies" /></a>
<a href="https://paypal.me/wzhouwzhou"><img src="https://img.shields.io/badge/donate-paypal-009cde.svg" alt="Paypal" /></a>
</p>
<p>
<a href="https://nodei.co/npm/discordblacklist/"><img src="https://nodei.co/npm/discordblacklist.png?stars=true&downloads=true"></a>
</p>
</div>

@@ -31,11 +44,11 @@ # Discordblacklist

// Check if they are on the banlist - Returns a true/false , or throws an error if an error occurred.
let isOnTheBanList = blacklist.lookup(someID);
// Check if they are on the banlist - Returns either null or the BannedUser.
let user = blacklist.lookup(someID);
// Get the full list in string JSON form. Must be used after update() has completed
const jsonified = blacklist.banstore.stringify(true);
const jsonified = blacklist.banstore.stringify(-1, true);
console.log(jsonified);
// If you installed optional dependencies (erlpack) use this.
const bufferstring = blacklist.banstore.stringify(false);
const bufferstring = blacklist.banstore.stringify(-1, false);
console.log(bufferstring);

@@ -46,2 +59,7 @@

// The first user on the banlist
const banneduser = array[0];
const sameBanneduser = blacklist.banstore.get('1');
console.log(banneduser);
### Setup and functions.

@@ -73,5 +91,7 @@

list and newList will contain a <BanStore> object which is a collection of BannedUser objects mapped by their banID. BannedUser objects have an id (userid), tag (discord tag), banID, bannedFor (reason), prooflink.
Used normally (i.e. caching enabled), BanStores will always be stored inside blacklist.banstore
To strip any class data and just get them in pure object form just run <BannedUser>.serialize() or <BanStore>.serialize(), and to stringify them <BannedUser> or <BanStore>.stringify().
<br></br>
**It is recommended you update your ban list every two hours**

@@ -97,2 +117,10 @@

**Looking up users.**
Convenience shortcut (only works after if banlist has been fetched and cached):
blacklist.lookup('id');
'id' is the userid of the user you want to check. This returns either a BannedUser or null depending on if the user is on the ban list.
**Clearing and resetting your auto-updater**

@@ -102,7 +130,2 @@

**Looking up users.**
Convenience shortcut (only works if banlist has been fetched and cached):
```blacklist.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**

@@ -119,6 +142,6 @@

Enjoy this package? Consider checking out some of my other work:
Enjoy this package? Consider starring on [github](https://github.com/wzhouwzhou/discordblacklist) and checking out some of my other work:
[ytsearcher](https://npmjs.com/ytsearcher)
[Youtube Search API](https://npmjs.com/ytsearcher)
[Chips Discord Bot](https://chipsbot.me/)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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