fluxpoint-node v0.5.0
Fluxpoint.js - Fluxpoint api nodejs wrapper
Usage
Logging into the api
This is pretty simple. You have to declare the api, and then the client.
const api = require('fluxpoint.js');
const Client = new api.Client("your fluxpoint token")
Note that if in any chance the token is not provided, you will get an error.
To verify if you are correctly logged in, just use the following code.
const api = require('fluxpoint.js');
const Client = new api.Client("Your fluxpoint token")
async function test(){
let me = await Client.me()
console.log(me) // Should return all your informations
}
test()
As told, if you provided an invalid token, an error will stop your code.
Else, it should return your informations. For me, it looks like :
{
id: '304541381798658048',
Name: 'Koro~ (Baka)#7963',
Token: 'my token',
Created: '2019-09-30T06:29:38.1070002Z',
Expire: null,
Donator: true,
Owner: false,
Disabled: false,
status: 'ok',
code: 200,
message: ''
}
Getting sfw image links
As told in this section, you first have to declare the client. Once it's done, you can use the following code :
async function test(){
let img = await Client.sfw("type")
console.log(img)
}
test()
Valid types are :
- anime
- wallpaper
- azurlane
- nekopara
If the type is invalid or no type is provided, the code will return null.
Getting nsfw image links
As told in this section, you first have to declare the client. Once it's done, you can use the following code :
async function test(){
let img = await Client.nsfw("type")
console.log(img)
}
test()
It's not that different from this code, you just have to add one letter!
Here, valid types are:
- azurlane
- nekopara
- lewd
As the sfw code, if the type is invalid or no type is provided, you will get a beautiful null.
Contributors
4 years ago