mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-09-10 21:12:30 +00:00
.github
bridge
contrib
docker
gateway
hook
img
internal
matterclient
matterhook
vendor
filippo.io
github.com
42wim
Baozisoftware
Benau
Jeffail
Philipp15b
Rhymen
SevereCloud
apex
av-elier
blang
bwmarrin
d5
davecgh
dustin
dyatlov
francoispqt
fsnotify
go-asn1-ber
go-telegram-bot-api
golang
golang-jwt
gomarkdown
google
gopackage
gorilla
graph-gophers
harmony-development
hashicorp
jpillora
json-iterator
kballard
kettek
keybase
klauspost
kyokomi
labstack
lrstanley
magiconair
matterbridge
mattermost
mattn
mdp
mgutz
minio
mitchellh
modern-go
monaco-io
mreiferson
mrexodia
nelsonken
opentracing
paulrosania
pborman
pelletier
philhofer
pkg
pmezard
remyoudompheng
rickb777
rivo
rs
russross
saintfish
shazow
sirupsen
sizeofint
skip2
slack-go
slack
internal
slackutilsx
.gitignore
.golangci.yml
CHANGELOG.md
LICENSE
Makefile
README.md
TODO.txt
admin.go
apps.go
attachments.go
audit.go
auth.go
block.go
block_action.go
block_context.go
block_conv.go
block_divider.go
block_element.go
block_file.go
block_header.go
block_image.go
block_input.go
block_object.go
block_rich_text.go
block_section.go
block_unknown.go
bookmarks.go
bots.go
channels.go
chat.go
comment.go
conversation.go
dialog.go
dialog_select.go
dialog_text.go
dnd.go
emoji.go
errors.go
files.go
groups.go
history.go
im.go
info.go
interactions.go
item.go
logger.go
logo.png
messageID.go
messages.go
metadata.go
misc.go
oauth.go
pagination.go
pins.go
reactions.go
reminders.go
remotefiles.go
rtm.go
search.go
security.go
slack.go
slash.go
socket_mode.go
stars.go
status_code_error.go
team.go
usergroups.go
users.go
views.go
webhooks.go
websocket.go
websocket_channels.go
websocket_desktop_notification.go
websocket_dm.go
websocket_dnd.go
websocket_files.go
websocket_groups.go
websocket_internals.go
websocket_managed_conn.go
websocket_misc.go
websocket_mobile_in_app_notification.go
websocket_pins.go
websocket_reactions.go
websocket_stars.go
websocket_subteam.go
websocket_teams.go
workflow_step.go
workflow_step_execute.go
spf13
stretchr
subosito
tinylib
valyala
vincent-petithory
vmihailenco
wiggin77
writeas
yaegashi
zfjagann
go.mau.fi
go.uber.org
golang.org
gomod.garykim.dev
google.golang.org
gopkg.in
layeh.com
lukechampine.com
modernc.org
rsc.io
modules.txt
version
.dockerignore
.fixmie.yml
.gitignore
.golangci.yaml
.goreleaser.yml
Dockerfile
Dockerfile_whatsappmulti
LICENSE
README.md
changelog.md
go.mod
go.sum
matterbridge.go
matterbridge.toml.sample
matterbridge.toml.simple
tgs.Dockerfile
43 lines
1.2 KiB
Go
43 lines
1.2 KiB
Go
package slack
|
|
|
|
// SectionBlock defines a new block of type section
|
|
//
|
|
// More Information: https://api.slack.com/reference/messaging/blocks#section
|
|
type SectionBlock struct {
|
|
Type MessageBlockType `json:"type"`
|
|
Text *TextBlockObject `json:"text,omitempty"`
|
|
BlockID string `json:"block_id,omitempty"`
|
|
Fields []*TextBlockObject `json:"fields,omitempty"`
|
|
Accessory *Accessory `json:"accessory,omitempty"`
|
|
}
|
|
|
|
// BlockType returns the type of the block
|
|
func (s SectionBlock) BlockType() MessageBlockType {
|
|
return s.Type
|
|
}
|
|
|
|
// SectionBlockOption allows configuration of options for a new section block
|
|
type SectionBlockOption func(*SectionBlock)
|
|
|
|
func SectionBlockOptionBlockID(blockID string) SectionBlockOption {
|
|
return func(block *SectionBlock) {
|
|
block.BlockID = blockID
|
|
}
|
|
}
|
|
|
|
// NewSectionBlock returns a new instance of a section block to be rendered
|
|
func NewSectionBlock(textObj *TextBlockObject, fields []*TextBlockObject, accessory *Accessory, options ...SectionBlockOption) *SectionBlock {
|
|
block := SectionBlock{
|
|
Type: MBTSection,
|
|
Text: textObj,
|
|
Fields: fields,
|
|
Accessory: accessory,
|
|
}
|
|
|
|
for _, option := range options {
|
|
option(&block)
|
|
}
|
|
|
|
return &block
|
|
}
|