fix !faftergame frestart

was calling the pmcmd version with the arguments inside chan instead of *rest
This commit is contained in:
jacob1 2014-12-18 18:16:14 -05:00
parent 61e41a5776
commit 3a7c7f777b

View File

@ -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")