Ping joined players even if the bot was quit and restarted manually

This commit is contained in:
nyuszika7h 2015-04-15 23:10:50 +02:00
parent 4ab966fc06
commit 1db767cafa

View File

@ -488,6 +488,15 @@ def forced_exit(cli, nick, chan, rest):
except Exception:
notify_error(cli, chan, errlog)
try:
with sqlite3.connect("data.sqlite3", check_same_thread=False) as conn:
c = conn.cursor()
players = var.list_players()
if players:
c.execute("UPDATE pre_restart_state SET players = ?", (" ".join(players),))
except Exception:
notify_error(cli, chan, errlog)
try:
reset()
except Exception: