Node.js Module

Install the package

First, install it with npm or your favourite package manager

npm install openblacklist

And import it in your app like so:

import { BlacklistClient } from "openblacklist"

Now, let's use it !

The syntax is very inspired by discord.js !

Create a Client with the BlacklistClient class

import { BlacklistClient } from "openblacklist"

const client = new BlacklistClient({ // Create your client
    key: "your-obl-key",
    path: "/urlpath",
    pass: "urlpass"
})

Recieve Post Requests

Listen on a port to recieve POST requests

And listen for event like, ready, add or remove !

Send Get Requests

There is actually only one method for that and it's the client.checkUser function !

Here is how to use it:

And that's pretty much it !

Yeah it's short but organises your code and makes it simple for you !

JS API Documentation

Methods

Method
Description
Returns

on(event, callback)

Listens for an event

off(event)

Unlistens for an event

listen(port)

Listen api calls to a port

Promise<void>

checkUser(id)

Checks if an user is blacklisted

Promise<Blacklist>

Events

Name
Description
Fields

ready

Emits when express is ready

port : number

add

Emits when someone is added to the blacklist

blacklist : Blacklist

remove

Emits when someone is removed from the blacklist

blacklist : Blacklist

Types

Last updated