2.0.2 • Published 3 years ago

ibl-api v2.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

infinity-api

Table Of Contents

Installation

NPM

npm install --save ibl-api

Yarn

yarn install ibl-api

Usage:

Posting:

const discord = require('discord.js');
const client = new discord.Client();
const { IBL } = require('ibl-api');

const ibl = new IBL(client, 'botAuth');

ibl.postStats() //Posts stats (retrieved from bot client)
ibl.autopost(60 * 60 * 1000) //Posts every hour

client.login('token');

Vote Webhooks:

const { IBL } = require('ibl-api');
const discord = require('discord.js');
const client = new discord.Client();

const ibl = new IBL(client, 'botAuth');
ibl.voteWebhook(
    'web auth', //web auth set on bot page
    3001, //port
    '/ibl/webhook' //path to post to, set on bot page
)

ibl.webhook.on("ready", port => {
    console.log(`Infinity Bot List webhook is listening on ${port}`)
});

ibl.webhook.on("vote", async (user, bot, type) => {
  console.log(`${user} voted for ${bot}`);
});

client.login('token');
2.0.2

3 years ago

2.0.1

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago