SlackMessage

to

Sets the channel, private group, or IM channel to send the message to.

Return: The SlackMessage instance.

text

Sets the text of the message.

Return: The SlackMessage instance.

actionsBlock

Creates and adds an Actions Block to the message's blocks. After creating the block, it will call the provided callback function to configure the Actions Block.

Return: The SlackMessage instance.

contextBlock

Creates and adds a Context Block to the message's blocks. After creating the block, it will call the provided callback function to configure the Context Block.

Return: The SlackMessage instance.

dividerBlock

Creates and adds a Divider Block to the message's blocks.

Return: The SlackMessage instance.

headerBlock

Creates and adds a Header Block to the message's blocks with the passed-in text. If a callback function is provided, it is called to configure the Header Block.

Return: The SlackMessage instance.

imageBlock

Creates and adds an Image Block 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.

Return: The SlackMessage instance.

sectionBlock

Creates and adds a Section Block to the message's blocks.

The provided callback function is called to configure the Section Block.

Return: The SlackMessage instance.

emoji

Sets the icon of the Slack Message to be the provided emoji.

Return: The SlackMessage instance.

image

Sets the icon of the Slack Message to be the provided image URL.

Return: The SlackMessage instance.

metadata

Add metadata for the given event type.

Return: The SlackMessage instance.

disableMarkdownParsing

Disables markdown parsing of the Slack Message text.

Return: The SlackMessage instance.

Pass true to enable unfurling of primarily text-based content.

Return: The SlackMessage instance.

unfurlMedia

Pass true to enable unfurling of media content.

Return: The SlackMessage instance.

username

Sets the username for the Slack Bot.

Return: The SlackMessage instance.

getMemento

Returns a serializable representation of this Slack Message.

Return: (struct) The serializable Slack Message

Throws: Megaphone.Provider.SlackBlockException

dump

Sends either the memento or a link to the Slack's BlockKit Builder to writeDump.

This method also accepts all the same arguments as writeDump.

Return: (void)

when

Control-flow helper to have if / else statements with method chaining.

Return: The SlackMessage instance.

Last updated