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:
parent
f96f9c5bc3
commit
24a8f2041f
|
@ -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"))
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue