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,6 +332,7 @@ class RichReplyMethods(object):
def errorNoCapability(self, capability, s='', **kwargs): def errorNoCapability(self, capability, s='', **kwargs):
log.warning('Denying %s for lacking %r capability', log.warning('Denying %s for lacking %r capability',
self.msg.prefix, capability) self.msg.prefix, capability)
if not conf.supybot.reply.noCapabilityError():
v = conf.supybot.replies.noCapability.get(self.msg.args[0])() v = conf.supybot.replies.noCapability.get(self.msg.args[0])()
s = self.__makeReply(v % capability, s) s = self.__makeReply(v % capability, s)
self.error(s, **kwargs) self.error(s, **kwargs)

View File

@ -170,6 +170,12 @@ error message (the uncaught exception) or a generic error message."""))
supybot.reply.register('errorInPrivate', registry.Boolean(False, """ supybot.reply.register('errorInPrivate', registry.Boolean(False, """
Determines whether the bot will send error messages to users in private.""")) 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, """ supybot.reply.register('whenNotCommand', registry.Boolean(True, """
Determines whether the bot will reply with an error message when it is 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 addressed but not given a valid command. If this value is False, the bot