2.2.2 • Published 7 years ago
discord-bans v2.2.2
discord-bans
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