LogoLogo
  • Introduction
  • What's New?
  • Upgrade Guide
  • Getting Started
    • Requirements
    • Installation
  • Defining Channels
    • Configuration
    • Retrieving Channels
  • Creating and Sending Notifications
    • Defining Notifications
    • Notifiables
    • Sending Notifications
  • Providers
    • DatabaseProvider
    • EmailProvider
    • SlackProvider
      • Slack BlockKit
    • Creating Custom Providers
  • Testing
    • Coming Soon
  • Reference
    • NotificationService
    • BaseNotification
    • SendsNotifications
    • INotifiable
    • BaseProvider
      • DatabaseProvider
        • DatabaseNotificationService
        • HasDatabaseNotifications
        • DatabaseNotificationCursor
        • DatabaseNotification
      • EmailProvider
      • SlackProvider
        • SlackMessage
          • EventMetadata
          • ActionsBlock
          • ContextBlock
          • DividerBlock
          • HeaderBlock
          • ImageBlock
          • SectionBlock
          • ButtonElement
          • ConfirmObject
          • ImageElement
          • TextObject
          • PlainTextOnlyTextObject
  • ForgeBox
  • GitHub
Powered by GitBook
On this page
  • init
  • id
  • text
  • field
  • accessory
  • getMemento
  1. Reference
  2. BaseProvider
  3. SlackProvider
  4. SlackMessage

SectionBlock

PreviousImageBlockNextButtonElement

Last updated 1 year ago

init

Creates an SectionBlock instance.

Slack Docs:

Name
Type
Required
Default
Description

No arguments

Return: The SectionBlock instance.

id

Sets a custom identifier for the SectionBlock instance.

Name
Type
Required
Default
Description

id

string

true

The custom identifier for the SectionBlock instance.

Return: The SectionBlock instance.

text

Sets the text for the SectionBlock instance.

Name
Type
Required
Default
Description

text

string

true

The text for the section. Maximum of 3000 characters.

Return: The SectionBlock instance.

field

Adds a text field to the SectionBlock instance.

Name
Type
Required
Default
Description

text

string

true

The text for the new text field. Maximum of 2000 characters.

Return: The TextObject added to the SectionBlock instance.

accessory

Sets the accessory for the SectionBlock instance.

Name
Type
Required
Default
Description

element

BlockKitElement

true

The Slack BlockKit element to set as the accessory for this SectionBlock instance.

Return: The SectionBlock instance.

getMemento

Converts the SectionBlock instance to a serializable format.

Name
Type
Required
Default
Description

No arguments

Return: (struct) A struct representing this SectionBlock instance.

{
    "type": "section",
    "text": {
        "type": "text",
        "text": "optional, either this or fields must be set"
    },
    "fields": [ ... ],
    "accessory": { ... },
    "block_id": "optional"
}
https://api.slack.com/reference/block-kit/blocks#section