Skip to content

Commit

Permalink
feat: added blocks function to view builder
Browse files Browse the repository at this point in the history
  • Loading branch information
testersen committed Feb 1, 2024
1 parent d6dae3c commit 975d9f8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/kotlin/no/telenor/slack/all.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package no.telenor.slack

import com.slack.api.methods.request.chat.ChatPostMessageRequest
import com.slack.api.model.view.View
import no.telenor.slack.block.*
import no.telenor.slack.composition.Markdown
import no.telenor.slack.composition.PlainText
Expand Down Expand Up @@ -291,3 +292,6 @@ fun multiChannelSelect(
// Meta
fun ChatPostMessageRequest.ChatPostMessageRequestBuilder.blocks(block: (@Dsl Blocks).() -> Unit) =
this.blocks(Blocks().apply(block).elements)!!

fun View.ViewBuilder.blocks(block: (@Dsl Blocks).() -> Unit) =
this.blocks(Blocks().apply(block).elements)!!

0 comments on commit 975d9f8

Please sign in to comment.