From 17a0348d9a63d87fcae04fac98a15a3df9d36c80 Mon Sep 17 00:00:00 2001 From: James Lu Date: Sun, 17 Sep 2017 11:45:10 -0700 Subject: [PATCH] Substitute $nick and friends with when exiting on Ctrl-C --- scripts/supybot | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/supybot b/scripts/supybot index dc1b48fc0..c3e17b1b8 100644 --- a/scripts/supybot +++ b/scripts/supybot @@ -117,7 +117,14 @@ def main(): for irc in world.ircs: quitmsg = conf.supybot.plugins.Owner.quitMsg() or \ 'Ctrl-C at console.' - quitmsg = ircutils.standardSubstitute(irc, None, quitmsg) + # Because we're quitting from the console, none of the + # standard msg substitutions exist, and these will show as + # raw strings by default. Substitute them here with + # something meaningful instead. + env = dict((key, '') + for key in ('who', 'nick', 'user', 'host')) + quitmsg = ircutils.standardSubstitute(irc, None, quitmsg, + env=env) irc.queueMsg(ircmsgs.quit(quitmsg)) irc.die() except SystemExit as e: