Skip to content

Commit

Permalink
Don't tell owner to contact an admin. Closes GH-20.
Browse files Browse the repository at this point in the history
  • Loading branch information
progval committed Jun 22, 2011
1 parent aefe980 commit 693ba6a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,10 @@ def replySuccess(self, s='', **kwargs):

def replyError(self, s='', **kwargs):
v = self._getConfig(conf.supybot.replies.error)
if 'msg' in kwargs:
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)

Expand Down Expand Up @@ -1205,7 +1209,7 @@ def _callCommand(self, command, irc, msg, *args, **kwargs):
if conf.supybot.reply.error.detailed():
irc.error(utils.exnToString(e))
else:
irc.replyError()
irc.replyError(msg=msg)

def getCommandHelp(self, command, simpleSyntax=None):
method = self.getCommandMethod(command)
Expand Down
5 changes: 5 additions & 0 deletions src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,11 @@ def setValue(self, v):
Determines what error message the bot gives when it wants to be
ambiguous.""")))

registerChannelValue(supybot.replies, 'errorOwner',
registry.NormalizedString(_("""An error has occurred and has been logged.
Check the logs for more informations."""), _("""Determines what error
message the bot gives to the owner when it wants to be ambiguous.""")))

registerChannelValue(supybot.replies, 'incorrectAuthentication',
registry.NormalizedString(_("""Your hostmask doesn't match or your password
is wrong."""), _("""Determines what message the bot replies with when
Expand Down

0 comments on commit 693ba6a

Please sign in to comment.