adjust pattern (word boundaries)
Browse files
app.py
CHANGED
@@ -96,7 +96,7 @@ async def on_message(message):
|
|
96 |
|
97 |
def extract_adjacent_words(content, trigger):
|
98 |
words = content.split()
|
99 |
-
pattern = r'\
|
100 |
regex = re.compile(pattern, re.IGNORECASE)
|
101 |
|
102 |
match = regex.search(content)
|
|
|
96 |
|
97 |
def extract_adjacent_words(content, trigger):
|
98 |
words = content.split()
|
99 |
+
pattern = r'\s*\b'.join(map(re.escape, trigger))
|
100 |
regex = re.compile(pattern, re.IGNORECASE)
|
101 |
|
102 |
match = regex.search(content)
|