From 53d372d11dfb6e79ad32ff4f707363d9d8ef8aac Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Fri, 14 Apr 2023 14:17:38 +0200 Subject: [PATCH] make keywords case insensitive --- matrix_pygmalion_bot/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matrix_pygmalion_bot/core.py b/matrix_pygmalion_bot/core.py index 2b44c79..0749ee2 100644 --- a/matrix_pygmalion_bot/core.py +++ b/matrix_pygmalion_bot/core.py @@ -64,7 +64,7 @@ class Callbacks(object): # parse keywords self.bot.extra_info = {"persona": [], "scenario": [], "example_dialogue": []} for i, keyword in enumerate(self.bot.keywords): - if re.search(keyword["regex"], event.body): + if re.search(keyword["regex"], event.body, flags=re.IGNORECASE): self.bot.keywords[i]['active'] = int(keyword["duration"]) logger.info(f"keyword \"{keyword['regex']}\" detected") if 'active' in self.bot.keywords[i]: