diff --git a/bot.py b/bot.py index 1cabc25..ce31cd7 100644 --- a/bot.py +++ b/bot.py @@ -22,11 +22,11 @@ async def on_message(message): if message.author == bot.user: return - # Check if the message contains "nixos" (case-insensitive, as a whole word) + # Check if the message contains "nixos" (case-insensitive, as a whole word, not in a URL) if re.search(r'\bnixos\b', message.content, re.IGNORECASE): - # Replace "nixos" with "fagOS" (preserving case of the first letter) + # Replace "nixos" with "fagOS" (preserving case of the first letter), but exclude URLs new_content = re.sub( - r'\b(nixos)\b', + r'(?