def METHOD_NAME(self, entity: MessageEntity, text: str) -> str:
    """
    Apply single entity to text
    :param entity:
    :param text:
    :return:
    """
    if entity.type in {
        MessageEntityType.BOT_COMMAND,
        MessageEntityType.URL,
        MessageEntityType.MENTION,
        MessageEntityType.PHONE_NUMBER,
        MessageEntityType.HASHTAG,
        MessageEntityType.CASHTAG,
        MessageEntityType.EMAIL,
    }:
        # These entities should not be changed
        return text
    if entity.type in {
        MessageEntityType.BOLD,
        MessageEntityType.ITALIC,
        MessageEntityType.CODE,
        MessageEntityType.UNDERLINE,
        MessageEntityType.STRIKETHROUGH,
        MessageEntityType.SPOILER,
    }:
        return cast(str, getattr(self, entity.type)(value=text))
    if entity.type == MessageEntityType.PRE:
        return (
            self.pre_language(value=text, language=entity.language)
            if entity.language
            else self.pre(value=text)
        )
    if entity.type == MessageEntityType.TEXT_MENTION:
        from aiogram.types import User
        user = cast(User, entity.user)
        return self.link(value=text, link=f"tg://user?id={user.id}")
    if entity.type == MessageEntityType.TEXT_LINK:
        return self.link(value=text, link=cast(str, entity.url))
    if entity.type == MessageEntityType.CUSTOM_EMOJI:
        return self.custom_emoji(value=text, custom_emoji_id=cast(str, entity.custom_emoji_id))
    # This case is not possible because of `if` above, but if any new entity is added to
    # API it will be here too
    return self.quote(text)