From 054ee6e4106b771d72a973cdd84eda5d4507ad74 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Tue, 11 Jul 2023 21:34:49 +0200 Subject: [PATCH] Disable generic error reply when supybot.replies.error is empty --- src/callbacks.py | 7 +++++-- src/conf.py | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/callbacks.py b/src/callbacks.py index 0844cca8e..e254d0bc3 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -506,8 +506,11 @@ class RichReplyMethods(object): msg = kwargs['msg'] if ircdb.checkCapability(msg.prefix, 'owner'): v = self._getConfig(conf.supybot.replies.errorOwner) - s = self.__makeReply(v, s) - return self.reply(s, **kwargs) + if v: + s = self.__makeReply(v, s) + return self.reply(s, **kwargs) + else: + self.noReply() def _getTarget(self, to=None): """Compute the target according to self.to, the provided to, diff --git a/src/conf.py b/src/conf.py index 16c554451..186419931 100644 --- a/src/conf.py +++ b/src/conf.py @@ -676,8 +676,9 @@ registerChannelValue(supybot.replies, 'success', registerChannelValue(supybot.replies, 'error', registry.NormalizedString(_("""An error has occurred and has been logged. - Please contact this bot's administrator for more information."""), _(""" - Determines what error message the bot gives when it wants to be + Please contact this bot's administrator for more information. + If this configuration variable is empty, no generic error message will be sent."""), + _("""Determines what error message the bot gives when it wants to be ambiguous."""))) registerChannelValue(supybot.replies, 'errorOwner',