1.0.2 • Published 4 years ago

sblapi.js v1.0.2

Weekly downloads
4
License
Apache-2.0
Repository
github
Last release
4 years ago

sblapi.js - The official JS API Wrapper for Syn Bot List

About

This is the official API wrapper for synbotlist.ga for NodeJS.

Installation

To install sblapi.js run this command in a terminal from your Discord bot folder:

Install sblapi.js:

npm install --save sblapi.js

Example Usage

const { Client } = require('discord.js');
const bot = new Client();

const SBL = require('gblapi.js');
const sblapi = new SBL(bot.user.id, 'XA-5caRv3qmbT8Q'); // Use your bot's user id and the SBL API token

bot.on('guildCreate', async (guild) => {
  console.log('Joined a new guild!');
  sblapi.updateStats(bot.guilds.size).catch(console.error);
  // catching any errors from promise
});

bot.login('your Discord bot token');
// ...
const SBL = require('gblapi.js');
const sblapi = new SBL('631072096906265949', 'XA-5caRv3qmbT8Q'); // Use your bot's user id and the SBL API token

setInterval(() => {
  sblapi.updateStats(guilds.size).catch(console.error);
}, 1 * 60 * 1000);
// update stats every minute

Author

Made by MarvelDC#8887.

Help

Join our Official Discord Server for help on this API wrapper.