aboutsummaryrefslogtreecommitdiffstats
path: root/bot/utils/helpers.py
blob: 74c2ccd040dd6fa7bec04e8d0afa2284208f5891 (plain) (blame)
1
2
3
4
5
6
7
8
import re


def suppress_links(message: str) -> str:
    """Accepts a message that may contain links, suppresses them, and returns them."""
    for link in set(re.findall(r"https?://[^\s]+", message, re.IGNORECASE)):
        message = message.replace(link, f"<{link}>")
    return message