slackalo

A Kotlin library to build and send Slack messages via Slack webhook url

Лицензия

Лицензия

Группа

Группа

com.gianluz
Идентификатор

Идентификатор

slackalo
Последняя версия

Последняя версия

1.2
Дата

Дата

Тип

Тип

module
Описание

Описание

slackalo
A Kotlin library to build and send Slack messages via Slack webhook url
Ссылка на сайт

Ссылка на сайт

https://github.com/gianluz/slackalo
Система контроля версий

Система контроля версий

https://github.com/gianluz/slackalo

Скачать slackalo

Зависимости

runtime (3)

Идентификатор библиотеки Тип Версия
org.jetbrains.kotlin : kotlin-stdlib-jdk8 jar 1.3.72
systems.danger : danger-kotlin-sdk jar 1.1
khttp » khttp jar 1.0.0

Модули Проекта

Данный проект не имеет модулей.

Maven Central



A Kotlin library to build and send Slack messages via Slack webhook

Dependency

Slackalo is available in maven central

dependencies {
    implementation 'com.gianluz:slackalo:1.0'
}

Introduction

Build your custom slack message just using the builder utils provided. Checkout the official Slack Block Kit Builder here Slackalo doesn't provide all the blocks right now, but you can contribute to make it more complete! Here you can find a list of what currently Slackalo support:

  • Section as PlainText or MarkdownText only
  • Image as ImageBlock
  • Section with Fields as FieldsBlock
  • Section with Image as ImagePlainTextBlock or ImageMarkdownBlock
  • Divider as Divider

Usage

To create a slack webhook url please follow the official slack app guide here

Here an example:

val message = slackMessage {
    blocks {
        plainText("Hello this is a plaintext")
        markdown("Hello this is a markdown")
        divider()
        imageMarkdown(
            ":warning: This is a message with an image and slack emoji",
             "https://api.slack.com/img/blocks/bkb_template_images/palmtree.png",
             "alt text"
        )
        divider()
        fields { 
            markdown("Field 1")
            markdown("Field 2")
            markdown("Field 3")
        }
    }
}
    
with(DefaultWebHookClient()) {
    sendWebHook("MySlackWebHookUrl", message)
}

Contribute

Please fork this repo, and add all the new functionalities you would like to have and open a Pull request!

Версии библиотеки

Версия
1.2
1.1
1.0