UNPKG

skywars

Version:

A Ranked SkyWars API for rating and leaderboard position.

16 lines (14 loc) 915 B
const fetch = require('node-fetch'); const URL = "https://api.luke.mx"; const Ranked = async function(uuid, key) { if (!key) return console.log('Error: No key was provided'); if (!uuid) return console.log('Error: No UUID was provided'); const data = await fetch(`https://api.hypixel.net/player?uuid=6effff87-6ad7-4e0e-be3a-21261848dc93&key=e6b0e0e9-08c2-4ee4-9048-1a674046c946`); const jsonData = await data.json().catch(() => { return console.log('Error: An error occurred while trying to fetch JSON data, this may be an outage.') }); if (data.status === 400) return console.log('Error: Your API key or data provided may be invalid, head over to discord.gg/NeqVuSy if you don\'t have a valid key.'); else if (data.status !== 200) return console.log(`Error: An error occurred with status ${data.status}.`); else return jsonData; } exports.getRanked = Ranked;