diff --git a/config.py b/config.py index 25c796b..34229c2 100644 --- a/config.py +++ b/config.py @@ -52,6 +52,7 @@ servers: dict[str, dict[str, Any]] = { "address": "irc.underworld.no", "channels": {"#random": 0, "#dice": 0}, "hosts": ["154.sub-174-251-241.myvzw.com"], + "threads": ["pingMon"], "dnsblMode": "kickban", }, "replirc": { diff --git a/threads.py b/threads.py index c77a229..dca0c79 100644 --- a/threads.py +++ b/threads.py @@ -148,7 +148,12 @@ def radio(instance: bare.bot) -> NoReturn: instance.log("Thread while loop broken", "FATAL") exit(1) +def ping(instance: bare.bot) -> NoReturn: + while 1: + instance.sendraw("PING :keepalive") + sleep(30) data: dict[str, dict[str, Any]] = { - "radio": {"noWrap": True, "func": radio, "passInstance": True} + "radio": {"noWrap": True, "func": radio, "passInstance": True}, + "pingMon": {"noWrap": True, "func": ping, "passInstance": True} }