This package has been deprecated

Author message:

New Version in the making, this version is not maintained anymore.

ngbl

1.2.1 • Public • Published

npm installinfo
npm version npm downloads

The Official API Module For NextGenBots.xyz in JavaScript.

Installation

Using npm

npm i ngbl

Using yarn

yarn add ngbl


Methods

  • .manualPost()
  • .autoPost()
  • .botInfo()
  • More coming soon

Example(s)

Methods usage:

const NGB = require('ngbl');
const api = new NGB('BOT_ID','API_KEY');
  • .manualPost()
api.manualPost('SERVER_COUNT').then(console.log);
  • .autoPost()

Time is OPTIONAL, it will default to 1 hour

Response is OPTIONAL, it will default to FALSE

api.autoPost('SERVER_COUNT','TIME_IN_MS', 'RESPONSE').then(console.log);
  • .botInfo()
api.botInfo('BOT_ID').then(console.log);

Botinfo Example

const NGB = require('ngbl');
module.exports.run = async (client, message, args) => {
    const api = new NGB(client.user.id, "EXAMPLE");
    let res = api.botInfo(args[0]);
    console.log(res)
    message.channel.send(res);
};

Auto Post Example

This will post ever HOUR (3.6e+6 = 1hour in milliseconds)

Time is OPTIONAL, it will default to 1 hour

Response is OPTIONAL, it will default to FALSE

const NGB = require('ngbl');
module.exports = (client) => {
    const api = new NGB(client.user.id, "EXAMPLE");
    api.autoPost(client.guilds.cache.size, 3.6e+6, true).then((r) => {
        console.log(r);
    }).catch((err) => {
        console.log(err);
    });
};
const NGB = require('ngbl');
module.exports = async (client) => {
    const api = new NGB(client.user.id, "EXAMPLE");
    let res = await api.autoPost(client.guilds.cache.size, 3.6e+6, true);
    console.log(res);
};

Manual Post Example

const NGB = require('ngbl');
module.exports = (client) => {
    const api = new NGB(client.user.id, "EXAMPLE");
    api.manualPost(client.guilds.cache.size).then((r) => {
        console.log(r);
    }).catch((err) => {
        console.log(err);
    });
};
const NGB = require('ngbl');
module.exports = async (client) => {
    const api = new NGB(client.user.id, "EXAMPLE");
    let res = await api.manualPost(client.guilds.cache.size);
    console.log(res);
};

Package Sidebar

Install

npm i ngbl

Weekly Downloads

1

Version

1.2.1

License

MIT

Unpacked Size

8.87 kB

Total Files

4

Last publish

Collaborators

  • cybercdn
  • itzvoid