Dinnerbone / mcstatus

A Python class for checking the status of an enabled Minecraft server
http://dinnerbone.com/minecraft/tools/status/
1.11k stars 146 forks source link

status.version does not have a sensible string representation #181

Closed KytoDevlopment closed 2 years ago

KytoDevlopment commented 2 years ago

from mcstatus import MinecraftServer server = MinecraftServer.lookup('0.tcp.eu.ngrok.io:11535') status = server.status() print(status) print('Le serveur 0.tcp.eu.ngrok.io:11535 a été trouvé. Il y a {0} joueurs connectés actuellement, {1} ms et le serveur est en {2}, {3}'.format(status.players.online, status.latency, status.description, status.version))

Output : Le serveur 0.tcp.eu.ngrok.io:11535 a été trouvé. Il y a 0 joueurs connectés actuellement, 50.881 ms et le serveur est en Survie Hard, <mcstatus.pinger.PingResponse.Version object at 0x000001DAE640FB50>

kevinkjt2000 commented 2 years ago

The version class does not have a double underscore string conversion function https://github.com/Dinnerbone/mcstatus/blob/a31e808b1f35190c3875645e40d5bc31a6f3a950/mcstatus/pinger.py#L187

Looks like there are two fields that can be referenced. I’m open to having double underscore functions as a pull request.

emirps commented 2 years ago

you can use status.version.name instead of status.version

KytoDevlopment commented 2 years ago

a