Closed masecla22 closed 5 years ago
Please put your code in a gist or at least proper code tags o_o!
Sorry >:
No worries please just do that so we can properly read the code/logs in order to help you ':D
https://gist.github.com/masecla22/ee3ae0b16da64a5ff76adbdaee1a982f This should do it
Please also remember to add the error exception/log to the gist for the next time.
For now socket.timeout: timed out
verify your server to be reachable from the machine the script is running on.
Double check that the server has enable-query=true
in the server.properties
. That was my problem. Once set to true
I was getting results for a query.
@masecla22 Has this issue been resolved for you?
After going through several of the older issues, I'm fairly certain that what netmonger is saying is the likely issue.
I am trying to make a discord bot that pings minecraft servers. This is my code (which just so happens to be the example you provided) ` # If you know the host and port, you may skip this and use MinecraftServer("example.org", 1234) server = MinecraftServer("doge.bitquest.co",25565)
'status' is supported by all Minecraft servers that are version 1.7 or higher.
And when I run this i get the following error
The server has 5 players and replied in 416.592 ms The server replied in 374.217 ms Ignoring exception in on_message Traceback (most recent call last): File "C:\Users\super\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\client.py", line 307, in _run_event yield from getattr(self, event)(*args, **kwargs) File "C:\Users\super\Desktop\BOTPY\DogeBit\bot.py", line 104, in on_message query = server.query() File "C:\Users\super\AppData\Local\Programs\Python\Python36-32\lib\site-packages\mcstatus\server.py", line 82, in query raise exception File "C:\Users\super\AppData\Local\Programs\Python\Python36-32\lib\site-packages\mcstatus\server.py", line 77, in query querier.handshake() File "C:\Users\super\AppData\Local\Programs\Python\Python36-32\lib\site-packages\mcstatus\querier.py", line 32, in handshake packet = self._read_packet() File "C:\Users\super\AppData\Local\Programs\Python\Python36-32\lib\site-packages\mcstatus\querier.py", line 25, in _read_packet packet.receive(self.connection.read(self.connection.remaining())) File "C:\Users\super\AppData\Local\Programs\Python\Python36-32\lib\site-packages\mcstatus\protocol\connection.py", line 175, in read result.extend(self.socket.recvfrom(self.remaining())[0]) socket.timeout: timed out
The server is online, and has the query enabled in it's code.