From 50be75a5e2868f369621912f4a722affd4680b72 Mon Sep 17 00:00:00 2001 From: jesopo Date: Mon, 20 Jan 2020 13:19:47 +0000 Subject: [PATCH] also do .format(**) when there's no `user` object --- src/core_modules/format_activity.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/core_modules/format_activity.py b/src/core_modules/format_activity.py index 409e9b06..0a910c68 100644 --- a/src/core_modules/format_activity.py +++ b/src/core_modules/format_activity.py @@ -15,13 +15,14 @@ class Module(ModuleManager.BaseModule): if user: formatting["~NICK"] = user.nickname - line = line.format(**formatting) - minimal = minimal.format(**formatting) - for key, value in formatting.items(): - if key[0] == "~": - formatting[key] = self._color(value) - pretty = pretty.format(**formatting) + line = line.format(**formatting) + minimal = minimal.format(**formatting) + + for key, value in formatting.items(): + if key[0] == "~": + formatting[key] = self._color(value) + pretty = pretty.format(**formatting) self.events.on("formatted").on(type).call(server=server, context=context, line=line, channel=channel, user=user,