Skip to main content

slack.postmessageprops

Home > @runlightyear/slack > PostMessageProps

PostMessageProps interface

Props for postMessage

Signature:
interface PostMessageProps 

Required Properties

PropertyModifiersTypeDescription
channelstringChannel, private group, or IM channel to send message to. Can be an encoded ID, or a name.

Optional Properties

PropertyModifiersTypeDescription
asUser?booleanSet to true to post the message as the authed user, instead of as a bot. Defaults to false. Cannot be used by new Slack apps.
attachments?stringAn array of attachments.
blocks?Array<BlockInput>An array of structured blocks
iconEmoji?string

Emoji to use as the icon for this message. Overrides iconUrl. Must be used in conjunction with asUser set to false, otherwise ignored.

Example :chart_with_upwards_trend:

iconUrl?stringURL to an image to use as the icon for this message. Must be used in conjunction with asUser set to false, otherwise ignored.
linkNames?stringFind and link user groups. No longer supports linking individual users.
metadata?EventMetadata you post to Slack is accessible to any app or user who is a member of that workspace.
mrkdwn?booleanDisable Slack markup parsing by setting to false. Enabled by default.
parse?"full" | "none"

Change how messages are treated.

Messages are formatted as described in the formatting spec. The formatting behavior will change depending on the value of parse.

By default, URLs will be hyperlinked. Set parse to none to remove the hyperlinks.

The behavior of parse is different for text formatted with mrkdwn. By default, or when parse is set to none, mrkdwn formatting is implemented. To ignore mrkdwn formatting, set parse to full.

replyBroadcast?booleanUsed in conjunction with thread_ts and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to false.
text?stringThe formatted text of the message to be published. If blocks are included, this will become the fallback text used in notifications.
threadTs?stringProvide another message's ts value to make this message a reply. Avoid using a reply's ts value; use its parent instead.
unfurlLinks?booleanPass true to enable unfurling of primarily text-based content.
unfurlMedia?booleanPass false to disable unfurling of media content.
username?stringSet your bot's user name. Must be used in conjunction with as_user set to false, otherwise ignored.