mirror of
https://github.com/minescope/mineping.git
synced 2024-12-27 11:15:47 +00:00
42 lines
980 B
TypeScript
42 lines
980 B
TypeScript
import { PingOptions } from "..";
|
|
|
|
export type BedrockPingResponse = {
|
|
version: {
|
|
name: string;
|
|
protocol: string;
|
|
};
|
|
players: {
|
|
max: string;
|
|
online: string;
|
|
};
|
|
description: string;
|
|
gamemode: string;
|
|
};
|
|
|
|
/**
|
|
* Asynchronously ping Minecraft Bedrock server.
|
|
*
|
|
* The optional `options` argument can be an object with a `ping` (default is `19132`) or/and `timeout` (default is `5000`) property.
|
|
*
|
|
* @param host The Bedrock server address.
|
|
*
|
|
* ```js
|
|
* import { pingBedrock } from 'mineping';
|
|
*
|
|
* const data = await pingBedrock('mco.mineplex.com');
|
|
* console.log(data);
|
|
* ```
|
|
*
|
|
* The resulting output will resemble:
|
|
* ```console
|
|
* {
|
|
* version: { name: 'Mineplex', protocol: '475' },
|
|
* players: { max: '5207', online: '5206' },
|
|
* description: ' New Costumes',
|
|
* gamemode: 'Survival'
|
|
* }
|
|
* ```
|
|
*/
|
|
export function pingBedrock(host: string, options?: PingOptions): Promise<BedrockPingResponse>;
|
|
|