This package has been deprecated

Author message:

Package no longer supported.

discord-bans
TypeScript icon, indicating that this package has built-in type declarations

2.2.2 • Public • Published

discord-bans Build Status Coverage Status Greenkeeper badge

NPM

Get a list of banned users from bans.discordlist.net

Installation

npm install discord-bans

Usage

Get your API token from bans.discordlist.net/mytoken.

const { DiscordBans } = require('discord-bans')
 
const bans = new DiscordBans('InflfYOe3Z')
 
bans.getList()
  .then(list => console.log(list))
  .catch(error => console.error(error))
 
bans.isbanned('179916759187456010')
  .then(isBanned => console.log(`User ${isBanned ? 'is' : 'is not'} banned`))
  .catch(error => console.error(error))

API

DiscordBans(token, minRefreshInterval)

const discordBans = new DiscordBans('InflfYOe3Z', 1000 * 30)

token

API token obtained from bans.discordlist.net/mytoken.

maxRefreshInterval

Minimum amount of time in ms between refreshes of the ID list. Default 1 minute.

The list is only refreshed if a method is called and the cache doesn't exist or is older than the maxRefreshInterval.

getList()

Returns a promise for an array of banned user IDs.

isBanned(userId)

Returns a promise for a boolean to indicate weather the user is on the list or not.

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i discord-bans

Weekly Downloads

2

Version

2.2.2

License

MIT

Last publish

Collaborators

  • dada1134