def METHOD_NAME(slack_token: str, build_url: str, ci_token: str, build_number: int, stage_name: str):
    """
        Sends a build report via slack.
        Args:
            slack_token (str): The slack token.
            build_url (str): The build URL.
            ci_token (str): The circle-ci token.
            build_number (int): The build number.
    """
    print(f"Sending Slack messages to {SLACK_CHANNEL}")
    steps_fields = []
    try:
        failed_entities, failed_docs = get_circle_failed_steps(ci_token=ci_token, build_number=build_number)
        if failed_docs:
            steps_fields = get_entities_fields('Warning:', failed_docs)
        if failed_entities:
            steps_fields += get_entities_fields(f'Failed Steps - ({len(failed_entities)})', failed_entities)
            color = 'danger'
            workflow_status = 'Failure'
        else:
            color = 'good'
            workflow_status = 'Success'
        send_message = bool(
            ((failed_docs or failed_entities) and stage_name == BUILD_STAGE)
            or stage_name == DEPLOY_STAGE
        )
        if send_message:
            slack_client = WebClient(token=slack_token)
            slack_client.chat_postMessage(
                channel=SLACK_CHANNEL,
                username="Content-Docs CircleCI",
                attachments=[{
                    'color': color,
                    'title': f'Content Docs Nightly {stage_name} - {workflow_status}',
                    'title_link': build_url,
                    'fields': steps_fields
                }]
            )
    except SlackApiError as e:
        assert e.response["error"]