dblabs.js
v1.0.1
Published
Official API wrapper for Discord Bot Labs
Downloads
1
Maintainers
Readme
Do you need my help? Visit our Discord server.
Installation
$ npm i dblabs.js
Usage
const DBLabs = require("dblabs.js");
const dbl = new DBLabs("API Key", client); // "API Key" Your private API Key //"client" when you define your Discord Client
client.on("ready", () => {
dbl.checkVote("your-bot-id").then((value) => {
console.log("Vote Check: " + value);
});
dbl.serverCount();
console.log(`Stats has been updated on Discord Bot Labs.`);
dbl.searchBot("your-bot-id").then((search) => {
console.log("Search result: " + search);
});
});
Detailed
Define Module
const DBLabs = require("dblabs.js");
const dbl = new DBLabs("API Key", client); // "API Key" Your private API Key //"client" when you define your Discord Client
Let's update the bot's data.
client.on("ready", () => {
dbl.serverCount();
console.log(`Stats has been updated on Discord Bot Labs.`);
});
// => Stats has been updated on Discord Bot Labs.
Let's check if a User has Voted.
client.on("ready", (bot) => {
dbl.checkVote("1061964752772931654").then((value) => {
console.log("Vote Check: " + value);
});
});
// => Vote Check: false/true
client.on("ready", () => {
dbl.searchBot("your-bot-id").then(search => {
console.log("Search result: " + search)
})
})
// => Search result:
/**
data: {
avatar: '',
botID: '',
username: '',
discrim: '',
shortDesc: '',
prefix: '/',
votes: 2,
ownerID: '',
tags: [ 'Moderation', 'Minecraft' ],
}
*/
---