Added supybot.reply.noCapabilityError.

This commit is contained in:
Jeremy Fincher 2004-01-20 22:39:15 +00:00
parent e8bba56f1f
commit 0cd95c63d5
2 changed files with 10 additions and 3 deletions

View File

@ -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])()

View File

@ -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