mirror of
https://github.com/Specoolazius/mcserver-discordbot.git
synced 2024-11-28 21:19:45 +01:00
18 lines
458 B
Python
18 lines
458 B
Python
|
from mcstatus import JavaServer
|
||
|
|
||
|
server = JavaServer.lookup('sfs.ddnss.org:25565', 10)
|
||
|
server = JavaServer('sfs.ddnss.org', 25565)
|
||
|
|
||
|
print('got server')
|
||
|
|
||
|
status = server.status()
|
||
|
print(f"The server has {status.players.online} players and replied in {status.latency} ms")
|
||
|
|
||
|
|
||
|
print(server.status())
|
||
|
print(vars(server.status()))
|
||
|
|
||
|
print(server.query())
|
||
|
|
||
|
query = server.query()
|
||
|
print(f"The server has the following players online: {', '.join(query.players.names)}")
|