2.0.4 • Published 5 years ago

dbu.js v2.0.4

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

dbu.js

An official Discord Bot Universe API wrapper written in Javascript for any Node.js bot for Discord.

Examples

// Create the client
const { Client } = require('dbu.js');
const dbu = new Client('api key');

// Get stats about the list
await dbu.stats(); // Returns an object of stats

// Get information about the current bot user
await dbu.me(); // Returns an object of information about the current bot

// Get information about a specific bot
await dbu.botInfo('bot id'); // Returns general information about the requested bot

// Gets if a user has liked the bot on botlistuniverse.ga
await dbu.botLiked('user id'); // Returns the timestamp of when they voted if they have, otherwise false

// Post servers to botlistuniverse.ga
await dbu.postServers(100); // Returns true if it posts successfully

// Get information about a specific user
await dbu.userInfo('user id'); // Returns an object of user information

Webhook

const { Webhook } = require('dbu.js');
const webhookServer = new Webhook({
    port: 1234, // required
    auth: 'password in dbu', // required
    path: '/webhook' // optional path for the webhook, defaults to /
});

webhookServer.on('like', (botId, userId) => { }); // create an event to handle when your bot is liked

webhookServer.on('unlike', (botId, userId) => { }); // create an event to handle when your bot is unliked

webhookServer.start(); // start the server
2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago