2024-01-29 21:55:25 +01:00
|
|
|
const { GameDig } = require('../dist/index.cjs')
|
|
|
|
// Instead of '../dist/index.cjs' you would have here 'gamedig'.
|
2023-10-30 22:35:39 +01:00
|
|
|
|
|
|
|
GameDig.query({
|
|
|
|
type: 'minecraft',
|
2024-01-22 22:17:07 +01:00
|
|
|
host: 'mc.hypixel.net',
|
|
|
|
port: 25565, // lets us explicitly specify the query port of this server
|
|
|
|
givenPortOnly: true // the library will attempt multiple ports in order to ensure success, to avoid this pass this option
|
2023-10-30 22:35:39 +01:00
|
|
|
}).then((state) => {
|
|
|
|
console.log(state)
|
|
|
|
}).catch((error) => {
|
|
|
|
console.log(`Server is offline, error: ${error}`)
|
|
|
|
})
|