slackbuildkit package - github.com/inkel/slackbuildkit - Go Packages

slackbuildkit

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2024 License: MIT Imports: 4 Imported by: 0

README

Slack Build Kit helper

The official Slack package, github.com/slack-go/slack, is very low-level to write messages using Slack Block Kit. This package tries to help using simpler objects.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockElement

type BlockElement interface {
	AsBlockElement() slack.BlockElement
}

type Button

type Button struct {
	// contains filtered or unexported fields
}

func NewButton

func NewButton(id, value, text string) *Button

func (*Button) AsBlockElement

func (b *Button) AsBlockElement() slack.BlockElement

func (*Button) WithURL

func (b *Button) WithURL(url string) *Button

type Message

type Message struct {
	// contains filtered or unexported fields
}

func (*Message) AddActions

func (m *Message) AddActions(id string, actions ...BlockElement) *Message

func (*Message) AddContext

func (m *Message) AddContext(id string, elems ...MixedElement)

func (*Message) AddSection

func (m *Message) AddSection(t *Text) *Message

func (*Message) Broadcast

func (m *Message) Broadcast() *Message

func (*Message) InThread

func (m *Message) InThread(ts string) *Message

func (*Message) Send

func (m *Message) Send(ctx context.Context, api *slack.Client, channel string) (string, error)

type MixedElement

type MixedElement interface {
	AsMixedElement() slack.MixedElement
}

type Text

type Text struct {
	strings.Builder
	// contains filtered or unexported fields
}

func Markdown

func Markdown() *Text

func Markdownf

func Markdownf(format string, args ...any) *Text

func PlainText

func PlainText() *Text

func (*Text) AsMixedElement

func (t *Text) AsMixedElement() slack.MixedElement

func (*Text) Printf

func (t *Text) Printf(format string, args ...any) *Text

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL