mirror of
https://github.com/fishyboteso/fishyboteso.git
synced 2024-08-30 18:32:13 +00:00
add notification dead,fighting
This commit is contained in:
parent
0924467487
commit
7656aecea0
@ -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():
|
||||||
|
@ -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)
|
||||||
|
@ -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)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user