1
0
mirror of https://github.com/osmarks/autobotrobot synced 2025-01-31 01:24:44 +00:00

Hopefully working autoreconnect

This commit is contained in:
osmarks 2021-10-16 23:15:11 +01:00
parent e3baa2cd90
commit bdb32764fb

View File

@ -71,9 +71,14 @@ async def initialize():
logging.info("Connected to %s on IRC", channel)
joined.add(channel)
def disconnect(conn, event):
logging.warn("Disconnected from IRC, reinitializing")
teardown()
asyncio.create_task(initialize)
# TODO: do better thing
conn.add_global_handler("welcome", connect)
conn.add_global_handler("disconnect", lambda conn, event: logging.warn("Disconnected from IRC"))
conn.add_global_handler("disconnect", disconnect)
conn.add_global_handler("nicknameinuse", inuse)
conn.add_global_handler("pubmsg", pubmsg)