1.0.2 • Published 3 years ago

@discordbotslist/sdk v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

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)
1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago