From 0cd95c63d552bfe56183e38b3d7ca410f1d9b464 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 20 Jan 2004 22:39:15 +0000 Subject: [PATCH] Added supybot.reply.noCapabilityError. --- src/callbacks.py | 7 ++++--- src/conf.py | 6 ++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/callbacks.py b/src/callbacks.py index db7b55411..4eab8f83c 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -332,9 +332,10 @@ class RichReplyMethods(object): def errorNoCapability(self, capability, s='', **kwargs): log.warning('Denying %s for lacking %r capability', self.msg.prefix, capability) - v = conf.supybot.replies.noCapability.get(self.msg.args[0])() - s = self.__makeReply(v % capability, s) - self.error(s, **kwargs) + if not conf.supybot.reply.noCapabilityError(): + v = conf.supybot.replies.noCapability.get(self.msg.args[0])() + s = self.__makeReply(v % capability, s) + self.error(s, **kwargs) def errorPossibleBug(self, s='', **kwargs): v = conf.supybot.replies.possibleBug.get(self.msg.args[0])() diff --git a/src/conf.py b/src/conf.py index d399dbdba..44c05b0f8 100644 --- a/src/conf.py +++ b/src/conf.py @@ -170,6 +170,12 @@ error message (the uncaught exception) or a generic error message.""")) supybot.reply.register('errorInPrivate', registry.Boolean(False, """ Determines whether the bot will send error messages to users in private.""")) +supybot.reply.register('noCapabilityError', registry.Boolean(False, """ +Determines whether the bot will send an error message to users who attempt to +call a command for which they do not have the necessary capability. You may +wish to make this False if you don't want users to understand the underlying +security system preventing them from running certain commands.""")) + supybot.reply.register('whenNotCommand', registry.Boolean(True, """ Determines whether the bot will reply with an error message when it is addressed but not given a valid command. If this value is False, the bot