Fixes to !fpull and !frestart
This commit is contained in:
parent
1d664fae6b
commit
797d95fac8
@ -768,7 +768,7 @@
|
||||
"no_command_in_channel": "You cannot use this command in channel right now",
|
||||
"no_such_role": "No such role: {0}",
|
||||
"available_modes": "Available game modes: \u0002",
|
||||
"process_exited": "Process %s exited with %s %d",
|
||||
"process_exited": "Process {0} exited with {1} {2}",
|
||||
"admin_fleave_deadchat": "You have forced {0} to leave the deadchat.",
|
||||
"available_mode_setters_help": "Votes to make a specific game mode more likely. Available game mode setters: ",
|
||||
"fspectate_help": "Usage: fspectate <wolfchat|deadchat> [on|off]",
|
||||
|
@ -465,12 +465,14 @@ def restart_program(cli, nick, chan, rest):
|
||||
"""Restarts the bot."""
|
||||
|
||||
args = rest.split()
|
||||
force = False
|
||||
|
||||
if botconfig.DEBUG_MODE or (args and args[0] == "-force"):
|
||||
if botconfig.DEBUG_MODE:
|
||||
force = True
|
||||
|
||||
if args and args[0] == "-force":
|
||||
force = True
|
||||
rest = " ".join(args[1:])
|
||||
else:
|
||||
force = False
|
||||
|
||||
if var.PHASE in var.GAME_PHASES:
|
||||
if var.PHASE == "join" or force:
|
||||
@ -509,7 +511,7 @@ def restart_program(cli, nick, chan, rest):
|
||||
rest = " ".join(args[1:])
|
||||
|
||||
if rest:
|
||||
msg += " ({0})".format(rest)
|
||||
msg += " ({0})".format(rest.strip())
|
||||
|
||||
cli.quit(msg.format(nick, rest.strip()))
|
||||
|
||||
@ -7280,10 +7282,7 @@ def fpull(cli, nick, chan, rest):
|
||||
ret = child.returncode
|
||||
|
||||
for line in (out + err).splitlines():
|
||||
if chan == nick:
|
||||
cli.msg(nick, line.decode("utf-8"))
|
||||
else:
|
||||
pm(cli, nick, line.decode("utf-8"))
|
||||
reply(cli, nick, chan, line.decode("utf-8"), private=True)
|
||||
|
||||
if ret != 0:
|
||||
if ret < 0:
|
||||
@ -7292,10 +7291,7 @@ def fpull(cli, nick, chan, rest):
|
||||
else:
|
||||
cause = "status"
|
||||
|
||||
if chan == nick:
|
||||
cli.msg(nick, messages["process_exited"] % (command, cause, ret))
|
||||
else:
|
||||
pm(cli, nick, messages["process_exited"] % (command, cause, ret))
|
||||
reply(cli, nick, chan, messages["process_exited"].format(command, cause, ret), private=True)
|
||||
|
||||
@cmd("fsend", flag="F", pm=True)
|
||||
def fsend(cli, nick, chan, rest):
|
||||
|
Loading…
Reference in New Issue
Block a user