def escape(text: str, *, mass_mentions: bool=False, formatting: bool=False
    ) ->str:
    """Get text with all mass mentions or markdown escaped.

    Parameters
    ----------
    text : str
        The text to be escaped.
    mass_mentions : `bool`, optional
        Set to :code:`True` to escape mass mentions in the text.
    formatting : `bool`, optional
        Set to :code:`True` to escpae any markdown formatting in the text.

    Returns
    -------
    str
        The escaped text.

    """
    if mass_mentions:
        text = text.replace('@everyone', '@\u200beveryone')
        text = text.replace('@here', '@\u200bhere')
    if formatting:
        text = text.replace('`', '\\`').replace('*', '\\*').replace('_', '\\_'
            ).replace('~', '\\~')
    return text
