[core] Add censor filter debug messages
This commit is contained in:
parent
2e4be2de15
commit
5bc69c8a33
|
@ -58,10 +58,13 @@ class Censor:
|
|||
async def __is_appropriate(self, message):
|
||||
for badword in await BadWord.objects.filter(hood=self.hood).all():
|
||||
if match(badword.pattern, message.text):
|
||||
logger.debug('Matched bad word - dropped message: %s' % message.text)
|
||||
return False
|
||||
for trigger in await Trigger.objects.filter(hood=self.hood).all():
|
||||
if match(trigger.pattern, message.text):
|
||||
logger.debug('Matched trigger - passed message: %s' % message.text)
|
||||
return True
|
||||
logger.debug('Did not match any trigger - dropped message: %s' % message.text)
|
||||
return False
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue