fun build()

in src/main/kotlin/jetbrains/buildServer/notification/slackNotifier/notification/MessagePayload.kt [57:67]


    fun build(): MessagePayload {
        val text = messageText.toString()
        if (text.isNotEmpty() && blocks.isNotEmpty()) {
            throw IllegalStateException("Can't send message with both text and blocks")
        }
        if (text.isNotEmpty()) {
            return MessagePayload(text = text)
        }

        return MessagePayload(text = getTextFromBlocks(), blocks = blocks)
    }