Fix Minecraft servere status

This commit is contained in:
Daniel Lovbrotte Olsen 2022-05-23 03:30:26 +02:00
parent 313cd57bf3
commit c909f3c008
1 changed files with 15 additions and 2 deletions

View File

@ -188,6 +188,10 @@ in
try: try:
pvv_status = pvv.status() pvv_status = pvv.status()
except:
pass
try:
dods_status = dods.status() dods_status = dods.status()
except: except:
pass pass
@ -196,10 +200,15 @@ in
try: try:
if pvv_status.players.online > 0: if pvv_status.players.online > 0:
result += ("P" + str(pvv_status.players.online)) result += ("P" + str(pvv_status.players.online))
if dods_status > 0:
result += ("D" + str(pvv_status.players.online))
except: except:
pass pass
try:
if dods_status.players.online > 0:
result += ("D" + str(dods_status.players.online))
except:
pass
print(result) print(result)
''; '';
click-left = "" + pkgs.writers.writePython3 "minecraft_status" { libraries = with pkgs.python3.pkgs; [ mcstatus notify2 ]; flakeIgnore = [ "E722" ]; } '' click-left = "" + pkgs.writers.writePython3 "minecraft_status" { libraries = with pkgs.python3.pkgs; [ mcstatus notify2 ]; flakeIgnore = [ "E722" ]; } ''
@ -214,6 +223,10 @@ in
try: try:
pvv_status = pvv.status() pvv_status = pvv.status()
except:
pass
try:
dods_status = dods.status() dods_status = dods.status()
except: except:
pass pass