slothapi.js

1.2.0 • Public • Published

slothapi.js

The official TheLazySloth API wrapper written in Javascript.

Table Of Contents

How to Install

npm i slothapi.js

Documentation

example usage with client

const Discord = require("discord.js"),
    client = new Discord.Client();
const SLOTHAPI = require("slothapi.js");
client.on("ready", () => {

    sloth = new SLOTHAPI(client, "API Token", true, 60000);
    sloth.on("post", (count) => console.log(`Posted guild count: ${count}`));
    sloth.on("error", (error) => console.error(`An Error Has Occured: ` + JSON.stringify(error)));

});
client.login("token");

example usage without client

const SLOTHAPI = require("slothapi.js"),
    // auto posting is not available with this
    api = new SLOTHAPI("Your Bot Client ID","The Lazy Sloth API Token");
    // see api methods for how to post guild counts

API Methods

You can also fetch other information from the api

Package Sidebar

Install

npm i slothapi.js

Weekly Downloads

1

Version

1.2.0

License

AGPL-3.0

Unpacked Size

44.6 kB

Total Files

6

Last publish

Collaborators

  • thelazysloth