From 5bc69c8a333e07cd9e0a60554c775e4469c73b14 Mon Sep 17 00:00:00 2001 From: Cathy Hu Date: Mon, 6 Jul 2020 14:37:26 +0200 Subject: [PATCH] [core] Add censor filter debug messages --- kibicara/platformapi.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kibicara/platformapi.py b/kibicara/platformapi.py index 46fe202..1055168 100644 --- a/kibicara/platformapi.py +++ b/kibicara/platformapi.py @@ -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