2020-08-13 20:14:25 +00:00
|
|
|
package serverapi
|
|
|
|
|
|
|
|
import "fmt"
|
|
|
|
|
|
|
|
// Ping is a Minecraft ping query
|
|
|
|
type Ping struct {
|
|
|
|
CurrentPlayers int `json:"current_players"`
|
|
|
|
MaxPlayers int `json:"max_players"`
|
|
|
|
Type string `json:"type"`
|
|
|
|
Version string `json:"version"`
|
|
|
|
MOTD string `json:"motd"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// Ping returns a Ping
|
|
|
|
func (c *Client) Ping() (ping *Ping, err error) {
|
2020-10-06 03:21:20 +00:00
|
|
|
return ping, c.jsonGET(fmt.Sprintf("%s/ping", c.endpoint), &ping)
|
2020-08-13 20:14:25 +00:00
|
|
|
}
|