mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-26 20:59:27 +01:00
BadWords: Make configuration variable requireWordBoundaries channel-specific
This commit is contained in:
parent
fcfa483efe
commit
123c176637
@ -52,7 +52,7 @@ BadWords = conf.registerPlugin('BadWords')
|
||||
conf.registerGlobalValue(BadWords, 'words',
|
||||
LastModifiedSetOfStrings([], _("""Determines what words are
|
||||
considered to be 'bad' so the bot won't say them.""")))
|
||||
conf.registerGlobalValue(BadWords,'requireWordBoundaries',
|
||||
conf.registerChannelValue(BadWords,'requireWordBoundaries',
|
||||
registry.Boolean(False, _("""Determines whether the bot will require bad
|
||||
words to be independent words, or whether it will censor them within other
|
||||
words. For instance, if 'darn' is a bad word, then if this is true, 'darn'
|
||||
|
@ -104,7 +104,7 @@ class BadWords(callbacks.Privmsg):
|
||||
|
||||
def makeRegexp(self, iterable):
|
||||
s = '(%s)' % '|'.join(map(re.escape, iterable))
|
||||
if self.registryValue('requireWordBoundaries'):
|
||||
if self.registryValue('requireWordBoundaries', channel):
|
||||
s = r'\b%s\b' % s
|
||||
self.regexp = re.compile(s, re.I)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user