/** * Slack Node - Version 2.1 * Discriminator: resource=message, operation=post */ interface Credentials { slackApi: CredentialReference; slackOAuth2Api: CredentialReference; } export type SlackV21MessagePostParams = { resource: 'message'; operation: 'post'; authentication?: 'accessToken' | 'oAuth2' | Expression; /** * Send Message To */ select?: 'channel' | 'user' | Expression; /** * The Slack channel to send to * @displayOptions.show { select: ["channel"] } * @default {"mode":"list","value":""} */ channelId?: { __rl: true; mode: 'list' | 'id' | 'name' | 'url'; value: string; cachedResultName?: string }; /** * User * @displayOptions.show { select: ["user"] } * @default {"mode":"list","value":""} */ user?: { __rl: true; mode: 'list' | 'id' | 'username'; value: string; cachedResultName?: string }; /** * Whether to send a simple text message, or use Slack’s Blocks UI builder for more sophisticated messages that include form fields, sections and more * @default text */ messageType?: 'text' | 'block' | 'attachment' | Expression; /** * The message text to post. Supports <a href="https://api.slack.com/reference/surfaces/formatting">markdown</a> by default - this can be disabled in "Options". * @displayOptions.show { messageType: ["text", "block"] } */ text?: string | Expression | PlaceholderValue; /** * Enter the JSON output from Slack's visual Block Kit Builder here. You can then use expressions to add variable content to your blocks. To create blocks, use <a target='_blank' href='https://app.slack.com/block-kit-builder'>Slack's Block Kit Builder</a> * @hint To create blocks, use <a target='_blank' href='https://app.slack.com/block-kit-builder'>Slack's Block Kit Builder</a> * @displayOptions.show { messageType: ["block"] } */ blocksUi?: string | Expression | PlaceholderValue; /** * Attachments * @displayOptions.show { messageType: ["attachment"] } * @default {} */ attachments?: { /** Required plain-text summary of the attachment */ fallback?: string | Expression | PlaceholderValue; /** Text */ text?: string | Expression | PlaceholderValue; /** Title */ title?: string | Expression | PlaceholderValue; /** Title Link */ title_link?: string | Expression | PlaceholderValue; /** Color of the line left of text * @default #ff0000 */ color?: string | Expression; /** Text which appears before the message block */ pretext?: string | Expression | PlaceholderValue; /** Name that should appear */ author_name?: string | Expression | PlaceholderValue; /** Author Link */ author_link?: string | Expression | PlaceholderValue; /** Icon which should appear for the user */ author_icon?: string | Expression | PlaceholderValue; /** Image URL */ image_url?: string | Expression | PlaceholderValue; /** Thumbnail URL */ thumb_url?: string | Expression | PlaceholderValue; /** Text of footer to add */ footer?: string | Expression | PlaceholderValue; /** Icon which should appear next to footer */ footer_icon?: string | Expression | PlaceholderValue; /** Timestamp of the message to post * @default 0 */ ts?: number | Expression; /** Fields to add to message * @default {} */ fields?: { /** Item */ item?: Array<{ /** Title */ title?: string | Expression | PlaceholderValue; /** Value */ value?: string | Expression | PlaceholderValue; /** Whether items can be displayed next to each other * @default true */ short?: boolean | Expression; }>; }; }; /** * Other options to set * @default {} */ otherOptions?: { /** Whether to append a link to this workflow at the end of the message. This is helpful if you have many workflows sending Slack messages. * @default true */ includeLinkToWorkflow?: boolean | Expression; /** Set an image or an emoji as the Profile Photo (avatar) of the bot sending the message. Will not be used if sending message as a user. * @default {"imageValues":[{"profilePhotoType":""}]} */ botProfile?: { /** Add Bot Profile Photo */ imageValues?: { /** Profile Photo Type */ profilePhotoType?: 'image' | 'emoji' | Expression; /** Only used if sending message as a bot. Use emoji codes like +1, not an actual emoji like 👍. <a target="_blank" href=" https://www.webfx.com/tools/emoji-cheat-sheet/">List of common emoji codes</a> * @displayOptions.show { profilePhotoType: ["emoji"] } */ icon_emoji?: string | Expression | PlaceholderValue; /** Only used if sending message as a bot * @displayOptions.show { profilePhotoType: ["image"] } */ icon_url?: string | Expression | PlaceholderValue; }; }; /** Whether to turn @users and #channels in message text into clickable links * @default false */ link_names?: boolean | Expression; /** Provide another message's Timestamp value to make this message a reply * @default {} */ thread_ts?: { /** Reply to a Message */ replyValues?: { /** Message timestamps are included in output data of Slack nodes, abbreviated to ts */ thread_ts?: number | Expression; /** Whether the reply should be made visible to everyone in the channel or conversation * @default false */ reply_broadcast?: boolean | Expression; }; }; /** Whether to use Slack Markdown to format the message * @default true */ mrkdwn?: boolean | Expression; /** Whether to enable unfurling of primarily text-based content * @default false */ unfurl_links?: boolean | Expression; /** Whether to disable unfurling of media content * @default true */ unfurl_media?: boolean | Expression; /** Whether to send a temporary, ephemeral message * @displayOptions.show { /select: ["channel"] } * @default {} */ ephemeral?: { /** Send as Ephemeral Message */ ephemeralValues?: { /** User to Send * @default {"mode":"list","value":""} */ user?: { __rl: true; mode: 'list' | 'id'; value: string; cachedResultName?: string }; /** Whether to send a temporary, ephemeral message * @default true */ ephemeral?: boolean | Expression; }; }; /** Whether to send a temporary, ephemeral message * @displayOptions.show { /select: ["user"] } * @default true */ ephemeral?: boolean | Expression; /** The message will be sent from this username (i.e. as if this individual sent the message). Add chat:write.customize scope on Slack API * @displayOptions.show { /authentication: ["accessToken"] } */ sendAsUser?: string | Expression | PlaceholderValue; }; }; export type SlackV21MessagePostOutput = { channel?: string; message?: { app_id?: string; blocks?: Array<{ block_id?: string; elements?: Array<{ elements?: Array<{ style?: { italic?: boolean; }; text?: string; type?: string; url?: string; }>; type?: string; }>; type?: string; }>; bot_id?: string; bot_profile?: { app_id?: string; deleted?: boolean; icons?: { image_36?: string; image_48?: string; image_72?: string; }; id?: string; name?: string; team_id?: string; updated?: number; }; team?: string; text?: string; ts?: string; type?: string; user?: string; }; message_timestamp?: string; ok?: boolean; }; export type SlackV21MessagePostNode = { type: 'n8n-nodes-base.slack'; version: 2.1; credentials?: Credentials; config: NodeConfig; output?: Items; };