mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2026-05-27 09:06:43 -04:00
Fix handling of word boundaries in Filter cog (#6725)
This commit is contained in:
@@ -475,7 +475,7 @@ class Filter(commands.Cog):
|
|||||||
|
|
||||||
if word_list:
|
if word_list:
|
||||||
pattern = re.compile(
|
pattern = re.compile(
|
||||||
"|".join(rf"\b{re.escape(w)}\b" for w in word_list), flags=re.I
|
"|".join(rf"(?<!\w){re.escape(w)}(?!\w)" for w in word_list), flags=re.I
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
pattern = None
|
pattern = None
|
||||||
|
|||||||
Reference in New Issue
Block a user