import re


def to_discord_title_safe(text: str) -> str:
    """Convert the given string to one that will be accepted by discord as a title for a
    channel.
    """
    text = text.replace(" ", "-")
    text = text[:96]
    text = text.lower()
    text = re.sub(r"[^a-zA-Z0-9\-]", "", text)  # Eliminate all non alpha numerics and `-`
    return re.sub(r"(\-)\1{1,}", "-", text)