1.1.0 • Published 5 years ago

discordbots.co v1.1.0

Weekly downloads
20
License
MIT
Repository
github
Last release
5 years ago

discordbots.co

Feature-rich yet lightweight API wrapper for discordbots.co.

Installation

Node.js LTS or newer is required.

npm install discordbots.co

Usage

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

const { APIClient } = require('discordbots.co');
const apiClient = new APIClient('API key', client.user.id);

// Post server and shard count to the website
client.on('ready', async () => {
  const serverCount = client.guilds.cache.size;
  await apiClient.post(serverCount);
});

client.login('CLIENT TOKEN');

// Get bot's information
apiClient.getBot().then(console.log).catch(console.error);