Here's the official module of Divine Discord Bot List API in JavaScript.
Using npm
npm i ddblapi.js
Using yarn
yarn add ddblapi.js
- .postStats()
- .getStats()
- .getVotes()
- .hasVoted24()
Methods usage:
const { ddblAPI } = require('ddblapi.js');
const ddbl = new ddblAPI('BOT_ID', 'API_KEY');
- .postStats()
ddbl.postStats('SERVER_COUNT')
.then(console.log);
- .getStats()
ddbl.getStats('BOT_ID')
.then(console.log);
- .getVotes()
ddbl.getVotes()
.then(console.log);
- .hasVoted24()
ddbl.hasVoted24('USER_ID')
.then(console.log);
Webhooks usage:
const { ddblWebhook } = require('ddblapi.js');
const ddbl = new ddblWebhook('PORT', 'AUTH', 'PATH');
ddbl.on('ready', (hook) => {
console.log(hook);
});
ddbl.on('vote', (vote) => {
console.log(vote);
});