Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

DevChromium/WynnJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WynnJS

A JavaScript wrapper for the official Wynncraft API, if you wish you may contribute to the wrapper. This wrapper is a modification of https://github.com/FraWolf/wynncraft.js, all rights of the fetchPlayer and fetchItem goes to the author of wynncraft.js.

Important

This wrapper is really outdated and is not in use anymore, if you want to contribute to it upgrading it. Feel free to do so.

Introduction

You only have a limited amount of API Calls per a certain period of time, this can differ per API endpoint. Please read more on the official documentation of the API. https://docs.wynncraft.com/

Table of Contents

Installation via Node Package Manager

To get the latest version of WynnJS please use the following command in a command prompt.

npm i --save @devchromium/wynnjs@latest

Usage

Initialization

const wynnJS = require("@devchromium/wynnjs");
const wynn = new WynnJS();

Legacy

fetchItem

This will return the item object from the item name you input.

let item = // code to get itemname
wynn.fetchItem(item)
.then(res => {
    // Code to display result
})
.catch(err => {
    console.log(err);
});

fetchGuild

This will return the guild object from the guild name you input (This does not work with guild prefixes).

let guild = // code to get guild
wynn.fetchGuild(guild)
.then(res => {
    // Code to display result
})
.catch(err => {
    console.log(err);
});

fetchServers

This will return all servers on the network.

wynn.fetchServers()
.then(res => {
    // Code to display result
})
.catch(err => {
    console.log(err);
});

fetchTerritories

This will return all the territories.

wynn.fetchTerritories()
.then(res => {
    // Code to display result
})
.catch(err => {
    console.log(err);
});

fetchGuildLeaderboard

This will return the top 100 guilds. Definiton of timeframe: this can be alltime

wynn.fetchGuildLeaderboard(timeframe)
.then(res => {
    // Code to display result
})
.catch(err => {
    console.log(err);
});

fetchPlayerLeaderboard

This will return the top 100 guilds. Definiton of timeframe: this can be alltime

wynn.fetchPlayerLeaderboard(timeframe)
.then(res => {
    // Code to display result
})
.catch(err => {
    console.log(err);
});

fetchPvPLeaderboard

This will return the top 100 guilds. Definiton of timeframe: this can be alltime

wynn.fetchPvPLeaderboard(timeframe)
.then(res => {
    // Code to display result
})
.catch(err => {
    console.log(err);
});

search

This will return a list of guild and player names which contain the search query, this is case-insensitive.

wynn.search(name)
.then(res => {
    // Code to display result
})
.catch(err => {
    console.log(err);
});

Version2

fetchPlayer

This will return the player object from the username you input.

let username = // code to get username
wynn.fetchPlayer(username)
.then(res => {
    // Code to display result
})
.catch(err => {
    console.log(err);
});

fetchIngredient

This will return the ingredient object from the ingredient name you input.

let ingredient = // code to get ingredient
wynn.fetchIngredient(ingredient)
.then(res => {
    // Code to display result
})
.catch(err => {
    console.log(err);
});

Releases

No releases published

Packages

No packages published