- Added game setting parser/stringifier 📝 - Added skin upload using mojang api 👾 - Added server ping using mcsrvstat.us 🖥️ - Added api and endpoints to the config ⚙️ - Added syscalls for modules 🧩
18 lines
457 B
JavaScript
18 lines
457 B
JavaScript
const config = require("../config.json")
|
|
|
|
async function fetchServerStatus() {
|
|
const response = await fetch(`https://api.mcsrvstat.us/3/${config.minecraft.server.host}:${config.minecraft.server.port}`)
|
|
const json = await response.json()
|
|
return {
|
|
online: json.online,
|
|
players: {
|
|
online: json.players.online || 0,
|
|
max: json.players.max || 0
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
module.exports = {
|
|
fetchServerStatus
|
|
} |