From daf4753907ad551379d685e3f17a18b8d367c0ca Mon Sep 17 00:00:00 2001 From: Jacob Henry Date: Mon, 10 Sep 2018 21:23:01 -0400 Subject: [PATCH] Big improves --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 8ee447e..ea3f13c 100644 --- a/main.py +++ b/main.py @@ -59,7 +59,7 @@ class ClientWrapper(object): self._hooks = OrderedDict() def add_hook(self, pattern, callback): - self._hooks[re.compile(pattern)] = callback + self._hooks[pattern] = callback def listen(self): feed = message_stream(self._slack) @@ -74,7 +74,7 @@ class ClientWrapper(object): text = msg['text'].strip() success = False for regex, callback in self._hooks.items(): - match = regex.match(text) + match = re.match(regex, text, flags=re.IGNORECASE) if match: success = True print("Matched on callback {}".format(callback))