Skip to content

botlists/abljswrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Astro Bot List API Wrapper v2

Currently, you can post and get your bot stats.

const Botlists = require('abl.js');

const abl = new Botlists('api-key', 'bot id');

/* get your bot stats */

abl
    .stats()
    .then((data) => console.log(data))
    .catch((err) => console.log(err));

/* post your bot stats */

abl
    .postStats(20, 0, 'online')
    .then((data) => console.log(data))
    .catch((err) => console.log(err));


/*
    First param is the servers
    second param is the shards
*/
Using async/await
    const Botlists = require('abl.js');
    
    const abl = new Botlists('api key', 'bot id');
    (async () => {
      try {
        const botStats = await abl.stats();
        console.log(botStats);
      } catch (e) {
        console.log(e);
      }
    
      try {
        const postStats = await abl.postStats(20, 0, 'online');
        console.log(postStats, 'here');
      } catch (e) {
        console.log(e);
      }
    })();