DBL Node SDK
Official module for the interacting with the API on DBL
Installation
yarn add @discordbotslist/sdk or npm i @discordbotslist/sdk
Introduction
The base class for the module is Api it takes your api key as a param. It provides you with many ways to interact with the DBL Api.
Examples
Posting Stats
const client = Discord.Client() // your Discord Client
const { Api } = require('@discordbotslist/sdk')
const api = new Api('key')
setInterval(() => {
api.postStats(client.user.id, {
serverCount: client.guilds.size,
shardCount: client.shard.count
})
}, 300000) // 1 / 5m or else you will get ratelimited
Getting bot Information
const client = Discord.Client() // your Discord Client
const { Api } = require('@discordbotslist/sdk')
const api = new Api('key')
api.getInfo(client.user.id).then(r => console.log)