npm.io
1.3.0 • Published 4 years ago

cardinaljs

Licence
Apache-2.0
Version
1.3.0
Deps
2
Size
73 kB
Vulns
0
Weekly
0
Stars
2

cardinaljs

The javascript library to interact with cardinal API.

About

cardinaljs is a Node.js module that allows you to interact with Cardinal API.

Installation

With the npm package:

npm install cardinaljs

Usage

const { Client } = require('cardinaljs');
const client = new Client();

//check the token validity
client.login('token')
  .then(token => console.log('Connected!'))
  .catch(err => console.error('Unable to connect: ' + err));

// Fetch a guild
client.guilds.resolve('guildID')
  .then(guild => {
    if (guild != undefined)
      console.log('Fetched guild ' + guild.guildName );
    else
      console.log('Guild wiht id guildID is not in Cardinal database.');
  })
  .catch(err => console.error('Could not resolve guild guildID: ' + err));

Keywords