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_command_in_channel": "You cannot use this command in channel right now",
|
||||||
"no_such_role": "No such role: {0}",
|
"no_such_role": "No such role: {0}",
|
||||||
"available_modes": "Available game modes: \u0002",
|
"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.",
|
"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: ",
|
"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]",
|
"fspectate_help": "Usage: fspectate <wolfchat|deadchat> [on|off]",
|
||||||
|
@ -465,12 +465,14 @@ def restart_program(cli, nick, chan, rest):
|
|||||||
"""Restarts the bot."""
|
"""Restarts the bot."""
|
||||||
|
|
||||||
args = rest.split()
|
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
|
force = True
|
||||||
rest = " ".join(args[1:])
|
rest = " ".join(args[1:])
|
||||||
else:
|
|
||||||
force = False
|
|
||||||
|
|
||||||
if var.PHASE in var.GAME_PHASES:
|
if var.PHASE in var.GAME_PHASES:
|
||||||
if var.PHASE == "join" or force:
|
if var.PHASE == "join" or force:
|
||||||
@ -509,7 +511,7 @@ def restart_program(cli, nick, chan, rest):
|
|||||||
rest = " ".join(args[1:])
|
rest = " ".join(args[1:])
|
||||||
|
|
||||||
if rest:
|
if rest:
|
||||||
msg += " ({0})".format(rest)
|
msg += " ({0})".format(rest.strip())
|
||||||
|
|
||||||
cli.quit(msg.format(nick, rest.strip()))
|
cli.quit(msg.format(nick, rest.strip()))
|
||||||
|
|
||||||
@ -7280,10 +7282,7 @@ def fpull(cli, nick, chan, rest):
|
|||||||
ret = child.returncode
|
ret = child.returncode
|
||||||
|
|
||||||
for line in (out + err).splitlines():
|
for line in (out + err).splitlines():
|
||||||
if chan == nick:
|
reply(cli, nick, chan, line.decode("utf-8"), private=True)
|
||||||
cli.msg(nick, line.decode("utf-8"))
|
|
||||||
else:
|
|
||||||
pm(cli, nick, line.decode("utf-8"))
|
|
||||||
|
|
||||||
if ret != 0:
|
if ret != 0:
|
||||||
if ret < 0:
|
if ret < 0:
|
||||||
@ -7292,10 +7291,7 @@ def fpull(cli, nick, chan, rest):
|
|||||||
else:
|
else:
|
||||||
cause = "status"
|
cause = "status"
|
||||||
|
|
||||||
if chan == nick:
|
reply(cli, nick, chan, messages["process_exited"].format(command, cause, ret), private=True)
|
||||||
cli.msg(nick, messages["process_exited"] % (command, cause, ret))
|
|
||||||
else:
|
|
||||||
pm(cli, nick, messages["process_exited"] % (command, cause, ret))
|
|
||||||
|
|
||||||
@cmd("fsend", flag="F", pm=True)
|
@cmd("fsend", flag="F", pm=True)
|
||||||
def fsend(cli, nick, chan, rest):
|
def fsend(cli, nick, chan, rest):
|
||||||
|
Loading…
Reference in New Issue
Block a user