mirror of
https://github.com/Specoolazius/mcserver-discordbot.git
synced 2025-08-03 10:27:12 +02:00
workz
This commit is contained in:
18
tests/minecraft.py
Normal file
18
tests/minecraft.py
Normal file
@@ -0,0 +1,18 @@
|
||||
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)}")
|
Reference in New Issue
Block a user