From 43f026dc64eebc3c3606629fec158ac7d105a5bd Mon Sep 17 00:00:00 2001 From: Andrew Developer Date: Tue, 28 Mar 2017 16:24:28 +0300 Subject: [PATCH] Added IGNORECASE flag to message_handler Added re.IGNORECASE flag to message_handler, so it matches without chars case. --- telebot/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telebot/__init__.py b/telebot/__init__.py index 248e9ef..3b70be9 100644 --- a/telebot/__init__.py +++ b/telebot/__init__.py @@ -852,7 +852,7 @@ class TeleBot: def _test_filter(self, filter, filter_value, message): test_cases = { 'content_types': lambda msg: msg.content_type in filter_value, - 'regexp': lambda msg: msg.content_type == 'text' and re.search(filter_value, msg.text), + 'regexp': lambda msg: msg.content_type == 'text' and re.search(filter_value, msg.text, re.IGNORECASE), 'commands': lambda msg: msg.content_type == 'text' and util.extract_command(msg.text) in filter_value, 'func': lambda msg: filter_value(msg) }