Class ChatPostMessageRequest.ChatPostMessageRequestBuilder
java.lang.Object
com.slack.api.methods.request.chat.ChatPostMessageRequest.ChatPostMessageRequestBuilder
- Enclosing class:
- ChatPostMessageRequest
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated.attachments(List<Attachment> attachments) A JSON-based array of structured attachments, presented as a URL-encoded string.attachmentsAsString(String attachmentsAsString) A JSON-based array of structured attachments, presented as a URL-encoded string.blocks(List<LayoutBlock> blocks) A JSON-based array of structured blocks, presented as a URL-encoded string.blocksAsString(String blocksAsString) A JSON-based array of structured blocks as a String, presented as a URL-encoded string.build()Channel, private group, or IM channel to send message to.eventAndEntityMetadata(Message.EventAndEntityMetadata eventAndEntityMetadata) JSON object with event and/or entity metadata.eventAndEntityMetadataAsString(String eventAndEntityMetadataAsString) JSON object with event and/or entity metadata.Emoji to use as the icon for this message.URL to an image to use as the icon for this message.linkNames(boolean linkNames) Find and link channel names and usernames.metadata(Message.Metadata metadata) JSON object with event_type and event_payload fields, presented as a URL-encoded string.metadataAsString(String metadataAsString) JSON object with event_type and event_payload fields, presented as a URL-encoded string.mrkdwn(boolean mrkdwn) Disable Slack markup parsing by setting to `false`.Change how messages are treated.replyBroadcast(boolean replyBroadcast) Used in conjunction with `thread_ts` and indicates whether reply should be made visible to everyone in the channel or conversation.Text of the message to send.Provide another message's `ts` value to make this message a reply.Authentication token.toString()unfurlLinks(boolean unfurlLinks) Pass true to enable unfurling of primarily text-based content.unfurlMedia(boolean unfurlMedia) Pass false to disable unfurling of media content.Set your bot's user name.
-
Method Details
-
token
Authentication token. Requires scope: `chat:write`- Returns:
this.
-
username
Set your bot's user name. Must be used in conjunction with `as_user` set to false, otherwise ignored. See [authorship](#authorship) below.- Returns:
this.
-
threadTs
Provide another message's `ts` value to make this message a reply. Avoid using a reply's `ts` value; use its parent instead.- Returns:
this.
-
channel
Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. See [below](#channels) for more details.- Returns:
this.
-
text
Text of the message to send. See below for an explanation of [formatting](#formatting). This field is usually required, unless you're providing only `attachments` instead.- Returns:
this.
-
parse
Change how messages are treated. Defaults to `none`. See [below](#formatting).- Returns:
this.
-
linkNames
Find and link channel names and usernames.- Returns:
this.
-
metadata
JSON object with event_type and event_payload fields, presented as a URL-encoded string. Metadata you post to Slack is accessible to any app or user who is a member of that workspace.- Returns:
this.
-
metadataAsString
public ChatPostMessageRequest.ChatPostMessageRequestBuilder metadataAsString(String metadataAsString) JSON object with event_type and event_payload fields, presented as a URL-encoded string. Metadata you post to Slack is accessible to any app or user who is a member of that workspace.- Returns:
this.
-
eventAndEntityMetadata
public ChatPostMessageRequest.ChatPostMessageRequestBuilder eventAndEntityMetadata(Message.EventAndEntityMetadata eventAndEntityMetadata) JSON object with event and/or entity metadata. For event metadata, provide event_type and event_payload fields. For entity metadata, provide the entities field. This field will overwrite the `metadata` field.- Returns:
this.
-
eventAndEntityMetadataAsString
public ChatPostMessageRequest.ChatPostMessageRequestBuilder eventAndEntityMetadataAsString(String eventAndEntityMetadataAsString) JSON object with event and/or entity metadata. For event metadata, provide event_type and event_payload fields. For entity metadata, provide the entities field. This field will overwrite the `metadata` field.- Returns:
this.
-
blocks
A JSON-based array of structured blocks, presented as a URL-encoded string.- Returns:
this.
-
blocksAsString
A JSON-based array of structured blocks as a String, presented as a URL-encoded string.- Returns:
this.
-
attachments
public ChatPostMessageRequest.ChatPostMessageRequestBuilder attachments(List<Attachment> attachments) A JSON-based array of structured attachments, presented as a URL-encoded string.- Returns:
this.
-
attachmentsAsString
public ChatPostMessageRequest.ChatPostMessageRequestBuilder attachmentsAsString(String attachmentsAsString) A JSON-based array of structured attachments, presented as a URL-encoded string.- Returns:
this.
-
unfurlLinks
Pass true to enable unfurling of primarily text-based content.- Returns:
this.
-
unfurlMedia
Pass false to disable unfurling of media content.- Returns:
this.
-
asUser
Deprecated.Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See [authorship](#authorship) below.NOTE: The default value is intentionally null to support workplace apps.
- Returns:
this.
-
mrkdwn
Disable Slack markup parsing by setting to `false`. Enabled by default.- Returns:
this.
-
iconUrl
URL to an image to use as the icon for this message. Must be used in conjunction with `as_user` set to false, otherwise ignored. See [authorship](#authorship) below.- Returns:
this.
-
iconEmoji
Emoji to use as the icon for this message. Overrides `icon_url`. Must be used in conjunction with `as_user` set to `false`, otherwise ignored. See [authorship](#authorship) below.- Returns:
this.
-
replyBroadcast
Used in conjunction with `thread_ts` and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to `false`.- Returns:
this.
-
build
-
toString
-