项目作者: wzhouwzhou

项目描述 :
The Featured Nodejs package that facilitates getting banned Discord users from DiscordBans.
高级语言: JavaScript
项目地址: git://github.com/wzhouwzhou/discordblacklist.git
创建时间: 2017-06-17T02:20:20Z
项目社区:https://github.com/wzhouwzhou/discordblacklist

开源协议:GNU Affero General Public License v3.0

下载






NPM version
NPM downloads
Build Status
Dependencies
Known Vulnerabilities
Paypal





Discordblacklist

Installing via NPM.

$ npm install --save discordblacklist@3.2.0 --only=production

Note: Version 3.2.x package API has changed from previous versions, all previous versions below 3.x are deprecated following a rewrite of the discordbans api as well as changed domains and removed features.

Version 3.2.x now allows you to bulk lookup more than 99 users at once.

Why discordblacklist?

• Fast, Light, and No bloat (Yes! Actually works with No other dependencies!), packed size is ~15kB

• Updated and Modern (Code standards and checks ensure code quality and aim for 0 vulnerabilities)

• Popular and Safe - the Oldest and Most Trusted Full-Coverage package with thousands of downloads, actively maintained by a verified DBans staff member.

I’m sold! How do I begin?

  1. // Create the object
  2. const Blacklist = require('discordblacklist');
  3. const token = 'My-token';
  4. const blacklist = new Blacklist(token);
  5. // Someone's id to test
  6. const someID = '1234567890';
  7. // Raw data from the banlist
  8. let data = await blacklist.lookup(someID);
  9. console.log(data);
  10. // No await:
  11. blacklist.lookup(someID).then(result => console.log(result));
  12. // Boolean they are on the banlist:
  13. let onTheList = await blacklist.isBanned(someID);
  14. console.log(onTheList);
  15. // No await:
  16. blacklist.isBanned(someID).then(result => console.log(result));
  17. // Bulk lookup several users (no maximum user count to lookup at once!)
  18. const ids = ['12345', '123456', '1234567'];
  19. data = await blacklist.bulkLookup(ids);
  20. // No await:
  21. blacklist.bulkLookup(ids).then(result => console.log(result));
  22. // Bulk lookup, but get the results mapped by user_id
  23. const mapdata = await bulkLookupMap(ids);

Changing token

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

This work is ©Copyright under the GNU AFFERO GENERAL PUBLIC LICENSE Version 3. See LICENSE for more details.

Enjoy this package? Consider starring on github and checking out some of my other work:

Youtube Search API

Fluent Filepaths

Urban Dictionary

Contact William Zhou#0001 via https://discord.gg/jj5FzF7 for more information.