updated the regex

This commit is contained in:
Xargana 2025-05-08 20:47:48 +03:00
parent 4d60c12d17
commit 4dcef3f841

View file

@ -28,7 +28,11 @@ class MessageHandler:
bot.test_commands = self.test_commands
# Regex for detecting "in X time" patterns
self.time_pattern = re.compile(r'in\s+(\d+\s+(?:hour|hours|minute|minutes|day|days|second|seconds)s?)', re.IGNORECASE)
self.time_pattern = re.compile(
r'in\s+((?:\d+\s*(?:seconds?|minutes?|hours?|days?|s|m|h|d)\s*)+)',
re.IGNORECASE
)
def parse_relative_time(self, time_str):
"""