@utils.cached_slot_property('_cs_clean_content')
def clean_content(self) -> str:
    ':class:`str`: A property that returns the content in a "cleaned up"\n        manner. This basically means that mentions are transformed\n        into the way the client shows it. e.g. ``<#id>`` will transform\n        into ``#name``.\n\n        This will also transform @everyone and @here mentions into\n        non-mentions.\n\n        .. note::\n\n            This *does not* affect markdown. If you want to escape\n            or remove markdown then use :func:`utils.escape_markdown` or :func:`utils.remove_markdown`\n            respectively, along with this function.\n        '
    if self.guild:

        def resolve_member(id: int) -> str:
            m = (self.guild.get_member(id) or utils.get(self.mentions, id=id))
            return (f'@{m.display_name}' if m else '@deleted-user')

        def resolve_role(id: int) -> str:
            r = (self.guild.get_role(id) or utils.get(self.role_mentions, id=id))
            return (f'@{r.name}' if r else '@deleted-role')

        def resolve_channel(id: int) -> str:
            c = self.guild._resolve_channel(id)
            return (f'#{c.name}' if c else '#deleted-channel')
    else:

        def resolve_member(id: int) -> str:
            m = utils.get(self.mentions, id=id)
            return (f'@{m.display_name}' if m else '@deleted-user')

        def resolve_role(id: int) -> str:
            return '@deleted-role'

        def resolve_channel(id: int) -> str:
            return f'#deleted-channel'
    transforms = {'@': resolve_member, '@!': resolve_member, '#': resolve_channel, '@&': resolve_role}

    def repl(match: re.Match) -> str:
        type = match[1]
        id = int(match[2])
        transformed = transforms[type](id)
        return transformed
    result = re.sub('<(@[!&]?|#)([0-9]{15,20})>', repl, self.content)
    return escape_mentions(result)
:class:`str`: A property that returns the content in a "cleaned up"
manner. This basically means that mentions are transformed
into the way the client shows it. e.g. ``<#id>`` will transform
into ``#name``.

This will also transform @everyone and @here mentions into
non-mentions.

.. note::

    This *does not* affect markdown. If you want to escape
    or remove markdown then use :func:`utils.escape_markdown` or :func:`utils.remove_markdown`
    respectively, along with this function.
@utils.cached_slot_property('_cs_clean_content')
def clean_content(self) -> str:
    ':class:`str`: A property that returns the content in a "cleaned up"\n        manner. This basically means that mentions are transformed\n        into the way the client shows it. e.g. ``<#id>`` will transform\n        into ``#name``.\n\n        This will also transform @everyone and @here mentions into\n        non-mentions.\n\n        .. note::\n\n            This *does not* affect markdown. If you want to escape\n            or remove markdown then use :func:`utils.escape_markdown` or :func:`utils.remove_markdown`\n            respectively, along with this function.\n        '
    if self.guild:

        def resolve_member(id: int) -> str:
            m = (self.guild.get_member(id) or utils.get(self.mentions, id=id))
            return (f'@{m.display_name}' if m else '@deleted-user')

        def resolve_role(id: int) -> str:
            r = (self.guild.get_role(id) or utils.get(self.role_mentions, id=id))
            return (f'@{r.name}' if r else '@deleted-role')

        def resolve_channel(id: int) -> str:
            c = self.guild._resolve_channel(id)
            return (f'#{c.name}' if c else '#deleted-channel')
    else:

        def resolve_member(id: int) -> str:
            m = utils.get(self.mentions, id=id)
            return (f'@{m.display_name}' if m else '@deleted-user')

        def resolve_role(id: int) -> str:
            return '@deleted-role'

        def resolve_channel(id: int) -> str:
            return f'#deleted-channel'
    transforms = {'@': resolve_member, '@!': resolve_member, '#': resolve_channel, '@&': resolve_role}

    def repl(match: re.Match) -> str:
        type = match[1]
        id = int(match[2])
        transformed = transforms[type](id)
        return transformed
    result = re.sub('<(@[!&]?|#)([0-9]{15,20})>', repl, self.content)
    return escape_mentions(result)