Skip to content

Commit 43f026d

Browse files
Added IGNORECASE flag to message_handler
Added re.IGNORECASE flag to message_handler, so it matches without chars case.
1 parent 7f31f8d commit 43f026d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎telebot/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,7 @@ def _test_message_handler(self, message_handler, message):
852852
def _test_filter(self, filter, filter_value, message):
853853
test_cases = {
854854
'content_types': lambda msg: msg.content_type in filter_value,
855-
'regexp': lambda msg: msg.content_type == 'text' and re.search(filter_value, msg.text),
855+
'regexp': lambda msg: msg.content_type == 'text' and re.search(filter_value, msg.text, re.IGNORECASE),
856856
'commands': lambda msg: msg.content_type == 'text' and util.extract_command(msg.text) in filter_value,
857857
'func': lambda msg: filter_value(msg)
858858
}

0 commit comments

Comments
 (0)