1.1.5 • Published 6 years ago

dblist-api v1.1.5

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
6 years ago

dblist-api

Installation

npm install dblist-api

Example

Example of posting server count with supported libraries (Discord.js and Eris)

const Discord = require("discord.js");
const client = new Discord.Client();
const dbl = require("dblist-api");
const dblist = new dbl('Your token', client);

dblist.on('posted', () => {
  console.log('Server count posted!');
})
dblist.on('error', e => {
 console.log(`Something went wrong! ${e}`);
})

Example of using webhooks to receive new votes

const dbl = require('dblist-api');
const dblist = new dbl('Your token', { webhookPort: 3080, webhookAuth: 'P4SSw0rD' });
dblist.webhook.on('ready', hook => {
  console.log(`Webhook is running at http://${hook.hostname}:${hook.port}${hook.path} ( Type your URL on bot settings on https://dblista.pl/ )`);
});
dblist.webhook.on('vote', vote => {
  console.log(`User with ID ${vote.user} just voted!`);
});

Example of post bot stats

const client = new Discord.Client();
const dbl = require("dblist-api");
const dblist = new dbl('Your token', client);

dblist.postStats();
1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago