From 3a7c7f777bd86512cc55fdcd563511d2edf64d7d Mon Sep 17 00:00:00 2001 From: jacob1 Date: Thu, 18 Dec 2014 18:16:14 -0500 Subject: [PATCH] fix !faftergame frestart was calling the pmcmd version with the arguments inside chan instead of *rest --- modules/wolfgame.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/wolfgame.py b/modules/wolfgame.py index e15d558..3519c25 100644 --- a/modules/wolfgame.py +++ b/modules/wolfgame.py @@ -383,9 +383,8 @@ def forced_exit(cli, nick, chan, *rest): # Admin Only -@pmcmd("frestart", admin_only=True) @cmd("frestart", admin_only=True) -def restart_program(cli, nick, chan, *rest): +def restart_program(cli, nick, chan, rest): """Restarts the bot.""" try: if var.PHASE in ("day", "night"): @@ -405,15 +404,19 @@ def restart_program(cli, nick, chan, *rest): finally: print("RESTARTING") python = sys.executable - if rest[-1].strip().lower() == "debugmode": + if rest.strip().lower() == "debugmode": os.execl(python, python, sys.argv[0], "--debug") - elif rest[-1].strip().lower() == "normalmode": + elif rest.strip().lower() == "normalmode": os.execl(python, python, sys.argv[0]) - elif rest[-1].strip().lower() == "verbosemode": + elif rest.strip().lower() == "verbosemode": os.execl(python, python, sys.argv[0], "--verbose") else: os.execl(python, python, *sys.argv) +@pmcmd("frestart", admin_only=True) +def pm_restart_program(cli, nick, rest): + restart_program(cli, nick, nick, rest) + @pmcmd("ping")