add notification dead,fighting

This commit is contained in:
Semjon Kerner 2021-03-26 12:18:29 +01:00
parent 0924467487
commit 7656aecea0
3 changed files with 9 additions and 7 deletions

View File

@ -33,7 +33,6 @@ class WindowClient:
WindowClient.clients.remove(self) WindowClient.clients.remove(self)
if len(WindowClient.clients) == 0: if len(WindowClient.clients) == 0:
window_server.stop() window_server.stop()
logging.info("window server stopped")
@staticmethod @staticmethod
def running(): def running():

View File

@ -162,8 +162,12 @@ def on_loot():
def on_fight(): def on_fight():
logging.info("FIGHTING") msg = "FIGHTING!"
logging.info(msg)
web.send_notification(msg)
def on_dead(): def on_dead():
logging.info("DEAD or INVENTORY FULL or NO BAIT EQUIPPED") msg = "DEAD or INVENTORY FULL or NO BAIT EQUIPPED"
logging.info(msg)
web.send_notification(msg)

View File

@ -51,12 +51,11 @@ def register_user(new_uid):
@fallback(None) @fallback(None)
def send_notification(uid, message): def send_notification(message):
# todo clean dead code if not is_subbed():
if not is_subbed(uid):
return False return False
body = {"uid": uid, "message": message, "apiversion":apiversion} body = {"uid": config.get("uid"), "message": message, "apiversion":apiversion}
requests.post(urls.notify, json=body) requests.post(urls.notify, json=body)