Add 'privateNotFound' channel config option to Encyclopedia, if set to True the bot will /msg the 'notfoundmsg' rather than send it in the channel

This commit is contained in:
Terence Simpson 2009-11-16 16:43:34 +00:00
parent f96f9c5bc3
commit 24a8f2041f
2 changed files with 7 additions and 2 deletions

View File

@ -36,3 +36,6 @@ conf.registerChannelValue(Encyclopedia, 'remotedb',
registry.String('http://ubottu.com/ubuntu.db', 'Remote location of the master database', private=True))
conf.registerChannelValue(Encyclopedia, 'ignores',
registry.SpaceSeparatedListOfStrings(['find', 'info'], 'factoid name(s) to ignore', private=True))
conf.registerChannelValue(Encyclopedia, 'privateNotFound',
registry.Boolean(False, "If set to True, send notfoundmsg in private rather than in the channel"))

View File

@ -481,8 +481,10 @@ class Encyclopedia(callbacks.Plugin):
ret = ret % repr(text)
if channel.lower() == irc.nick.lower():
queue(irc, msg.nick, ret)
return
queue(irc, channel, ret)
elif self.registryValue('privateNotFound', channel):
queue(irc, msg.nick, ret)
else:
queue(irc, channel, ret)
return
if doChanMsg and channel.lower() != irc.nick.lower() and target[0] != '#': # not /msg
if target in irc.state.channels[channel].users: