fix !frestart not actually restarting the bot
This commit is contained in:
parent
040be2ff31
commit
d8bc216df4
@ -581,16 +581,20 @@ def restart_program(cli, nick, chan, rest):
|
|||||||
except Exception:
|
except Exception:
|
||||||
notify_error(cli, chan, errlog)
|
notify_error(cli, chan, errlog)
|
||||||
|
|
||||||
@hook("error")
|
@hook("quit")
|
||||||
def restart_buffer(*s):
|
def restart_buffer(cli, raw_nick, reason):
|
||||||
plog("RESTARTING")
|
nick, _, __, cloak = parse_nick(raw_nick)
|
||||||
|
# restart the bot once our quit message goes though to ensure entire IRC queue is sent
|
||||||
|
# if the bot is using a nick that isn't botconfig.NICK, then stop breaking things and fdie
|
||||||
|
if nick == botconfig.NICK:
|
||||||
|
plog("RESTARTING")
|
||||||
|
|
||||||
python = sys.executable
|
python = sys.executable
|
||||||
|
|
||||||
if mode:
|
if mode:
|
||||||
os.execl(python, python, sys.argv[0], "--{0}".format(mode))
|
os.execl(python, python, sys.argv[0], "--{0}".format(mode))
|
||||||
else:
|
else:
|
||||||
os.execl(python, python, *sys.argv)
|
os.execl(python, python, *sys.argv)
|
||||||
|
|
||||||
|
|
||||||
@cmd("ping", chan=False, pm=True)
|
@cmd("ping", chan=False, pm=True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user