From 946e84cbd328912845c4e75531ab406ee4448c96 Mon Sep 17 00:00:00 2001 From: nyuszika7h Date: Tue, 25 Oct 2016 17:00:50 +0200 Subject: [PATCH] Add !update command --- src/wolfgame.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/wolfgame.py b/src/wolfgame.py index d47a2f3..4265ea8 100644 --- a/src/wolfgame.py +++ b/src/wolfgame.py @@ -7293,6 +7293,17 @@ def fpull(cli, nick, chan, rest): reply(cli, nick, chan, messages["process_exited"].format(command, cause, ret), private=True) +@cmd("update", flag="D", pm=True) +def update(cli, nick, chan, rest): + """Pulls from the repository and restarts the bot to update it.""" + + if update.aftergame: + # Display "Scheduled restart" instead of "Forced restart" when called with !faftergame + restart_program.aftergame = True + + fpull.caller(cli, nick, chan, "") + restart_program.caller(cli, nick, chan, "Updating bot") + @cmd("fsend", flag="F", pm=True) def fsend(cli, nick, chan, rest): """Forcibly send raw IRC commands to the server."""