CatBoat-Launcher/modules/serverPing.js
Azure 13c6f14886 Added few internals modules
-  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 🧩
2025-04-29 11:08:58 +02:00

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
}