node.js package

Offical Docs for the discord-botlist.eu node package

Welcome on the official discord-botlist API Docs On this site you will learn how to use our API

Installation

To install our package, just type the following sentence in your console:

npm i discord-botlist-api

This version of the API is still in Beta and could contain Bugs.

How to use it

Currently, our API is only supporting a server count for the Website. Here you can see, how to set it up:

index.js
const Discord = require('discord.js')
const client = new Discord.Client();
const dbeu = require('discord-botlist-api')
const dbapi = new dbeu.Client();
dbapi.on("ready", () => {
console.log("[LOG] API logged in!")
dbapi.autoPost(client)
})
dbapi.login("56426894269035716951", "636302950603685916")

Alternative you can use this to post your serverstats

const Discord = require('discord.js')
const client = new Discord.client()
const dbeu = require('discord-botlist-api')
const dbapi = new dbeu.Client();
dbapi.on("ready", () => {
console.log("[LOG] API logged in!")
setInterval(() => {
dbapi.postData(SERVER_COUNT, SHARD_COUNT)
}, 30000);
})
dbapi.login("API_TOKEN", "BOT_ID")

Posting wrong server stats will result in an API ban

Get Votes

In this section, you will learn how to get Votes through our npm package. Its pretty easy:

index.js
dbapi.on("vote", vote => {
console.log(vote)
})

Vote looks like this:

botID: "665501479657930782",
user: {
"name": "VOTED_USER_NAME",
"id": "VOTED_USER_ID",
"else": "OTHER_STUFF"
}