Skip to content

Commit 681c6cd

Browse files
committed
Update mcping for new mcstatus version
1 parent 2607b22 commit 681c6cd

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

plugins/minecraft_ping.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ def mcping(text):
4444
else:
4545
description = format_colors(" ".join(s.description.split()))
4646

47-
return "{}\x0f - \x02{}\x0f - \x02{:.1f}ms\x02" \
48-
" - \x02{}/{}\x02 players".format(description, s.version.name, s.latency,
49-
s.players.online, s.players.max).replace("\n", "\x0f - ")
47+
if s.latency:
48+
return "{}\x0f - \x02{}\x0f - \x02{:.1f}ms\x02" \
49+
" - \x02{}/{}\x02 players".format(description, s.version.name, s.latency,
50+
s.players.online, s.players.max).replace("\n", "\x0f - ")
51+
else:
52+
return "{}\x0f - \x02{}\x0f" \
53+
" - \x02{}/{}\x02 players".format(description, s.version.name,
54+
s.players.online, s.players.max).replace("\n", "\x0f - ")

0 commit comments

Comments
 (0)