deltabot.py: sync changes
This commit is contained in:
parent
5b0cff26c4
commit
d5f84d6254
1 changed files with 2 additions and 2 deletions
|
|
@ -868,7 +868,6 @@ def monitor_worker(account):
|
||||||
time.sleep(MONITOR_INTERVAL)
|
time.sleep(MONITOR_INTERVAL)
|
||||||
monitors = load_monitors()
|
monitors = load_monitors()
|
||||||
changed = False
|
changed = False
|
||||||
subscribers = load_subscribers()
|
|
||||||
for m in monitors:
|
for m in monitors:
|
||||||
ok, detail = check_url(m["url"])
|
ok, detail = check_url(m["url"])
|
||||||
was_ok = m.get("last_ok")
|
was_ok = m.get("last_ok")
|
||||||
|
|
@ -878,7 +877,8 @@ def monitor_worker(account):
|
||||||
alert = f"Сайт восстановлен\n{m['url']}"
|
alert = f"Сайт восстановлен\n{m['url']}"
|
||||||
else:
|
else:
|
||||||
alert = f"САЙТ НЕДОСТУПЕН\n{m['url']}\nСтатус: {detail}"
|
alert = f"САЙТ НЕДОСТУПЕН\n{m['url']}\nСтатус: {detail}"
|
||||||
for accid, chat_id in list(subscribers):
|
chat_id = m.get("added_chat")
|
||||||
|
if chat_id:
|
||||||
try:
|
try:
|
||||||
account._rpc.send_msg(account.id, chat_id, {"text": alert})
|
account._rpc.send_msg(account.id, chat_id, {"text": alert})
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue