Sets the channel, private group, or IM channel to send the message to.
Name
Type
Required
Default
Description
The channel, private group, or IM channel to send the message to.
Return : The SlackMessage instance.
Sets the text of the message.
Name
Type
Required
Default
Description
Return : The SlackMessage instance.
Creates and adds an Actions Blockarrow-up-right to the message's blocks. After creating the block, it will call the provided callback function to configure the Actions Block.
Name
Type
Required
Default
Description
The callback function to configure the created Actions Block.
Return : The SlackMessage instance.
ActionsBlock chevron-right Creates and adds a Context Blockarrow-up-right to the message's blocks. After creating the block, it will call the provided callback function to configure the Context Block.
Name
Type
Required
Default
Description
The callback function to configure the created Context Block.
Return : The SlackMessage instance.
ContextBlock chevron-right Creates and adds a Divider Blockarrow-up-right to the message's blocks.
Name
Type
Required
Default
Description
Return : The SlackMessage instance.
DividerBlock chevron-right Creates and adds a Header Blockarrow-up-right to the message's blocks with the passed-in text. If a callback function is provided, it is called to configure the Header Block.
Name
Type
Required
Default
Description
The callback function to configure the created Header Block.
Return : The SlackMessage instance.
HeaderBlock chevron-right Creates and adds an Image Blockarrow-up-right to the message's blocks with the passed-in imageUrl.
If altText is not provided when constructing the Image Block, it must be provided in the callback.
If a callback function is provided, it is called to configure the Image Block.
Name
Type
Required
Default
Description
The url for the image of the block.
The alt text for the image. If no alt text is provided, it must be configured in the callback.
The callback function to configure the created Image Block.
Return : The SlackMessage instance.
ImageBlock chevron-right Creates and adds a Section Block to the message's blocks.
The provided callback function is called to configure the Section Block.
Name
Type
Required
Default
Description
The callback function to configure the created Section Block.
Return : The SlackMessage instance.
SectionBlock chevron-right Sets the icon of the Slack Message to be the provided emoji.
Name
Type
Required
Default
Description
The emoji code to set as the icon, e.g. :chart_with_upwards_trend:
Return : The SlackMessage instance.
Sets the icon of the Slack Message to be the provided image URL.
Name
Type
Required
Default
Description
The image URL to set as the icon.
Return : The SlackMessage instance.
Add metadata for the given event type.
Name
Type
Required
Default
Description
The event type to track metadata for.
Return : The SlackMessage instance.
EventMetadata chevron-right disableMarkdownParsing
Disables markdown parsing of the Slack Message text.
Name
Type
Required
Default
Description
Return : The SlackMessage instance.
Pass true to enable unfurling of primarily text-based content.
Name
Type
Required
Default
Description
Boolean flag to unfurl links or not.
Return : The SlackMessage instance.
Pass true to enable unfurling of media content.
Name
Type
Required
Default
Description
Boolean flag to unfurl media or not.
Return : The SlackMessage instance.
Sets the username for the Slack Bot.
Name
Type
Required
Default
Description
The username to use for the Slack Bot.
Return : The SlackMessage instance.
Returns a serializable representation of this Slack Message.
Name
Type
Required
Default
Description
Return : (struct) The serializable Slack Message
triangle-exclamation
Throws: Megaphone.Provider.SlackBlockException
Sends either the memento or a link to the Slack's BlockKit Builderarrow-up-right to writeDump.
Name
Type
Required
Default
Description
Return : (void)
Control-flow helper to have if / else statements with method chaining.
Name
Type
Required
Default
Description
The callback to execute if the boolean value is true.
The optional callback to execute if the boolean value is false.
Return : The SlackMessage instance.