Skip to content
This repository has been archived by the owner on Apr 23, 2020. It is now read-only.
/ VAPI-NODE Public archive

VastLands API Wrapper - Written in Node.JS

Notifications You must be signed in to change notification settings

VastLands/VAPI-NODE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VAPI

VastLands API Wrapper - Written in Node.JS

##Requirements Node.JS >= 8.11.2

##How to use? 🎈 Run npm install vapi

Lets' get started now:

 /*
  * The VAPI accepts a user agent parameter, which is required, 
  * Also, ensure it's less or equal to 256 characters
  * Or an exception will be thrown...
  */
  
let vapi = require("vapi")("My Epic Bot")

Now you can make use of the vapi

 /*
  * The FetchProfile accepts the player username as the parameter! 
  */

vapi.FetchProfile("Suremeoz").then(profile=> {
    console.log(profile)
})

But Wait, before you do anything, let's make sure the username is valid, and exists. We've made your job easier by having this variable you can use.

vapi.FetchProfile("Suremeoz").then(profile=> {
    if (profile.Valid) {
        // Continue    
    } else {
        // Handle Error
    }
})

Now you can utilize all those juicy variables in the profile object.

###Real Cool Examples💣

Get a players current rank

let vapi = require("vapi")("my epic bot")

vapi.FetchProfile("Suremeoz").then(profile=> {
    if(profile.Valid) {
        console.log(`${profile.Username}'s rank is ${profile.Rank}`)
    } else {
        console.log(profile.Message)
    }  
})

###Help & inquiries If you have any questions, or wish to suggest something, open a issue template and we'll get back to you as soon as possible!

About

VastLands API Wrapper - Written in Node.JS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published