Skip to main content

Slack Blocks

@mgreten/slack-blocksv2026.05.20.1· 1d agoMODELS
01README

Post Block Kit messages to Slack from swamp models and workflows, with optional file attachments uploaded via the modern external-upload flow. Three methods: send (text + blocks + optional thread reply), sendWithFiles (uploads local files first, then posts a message referencing them), and verifyAuth (auth.test smoke check after token setup).

02Release Notes

Initial release: chat.postMessage with Block Kit + file uploads shared into the message thread + auth.test verifier

03Models1
@mgreten/slack-blocksv2026.05.20.1slack_blocks.ts
fn send(channel?: string, text: string, blocks: array, threadTs?: string)
Post a Block Kit message to Slack via chat.postMessage. `text` is required as the notification/accessibility fallback.
ArgumentTypeDescription
channel?stringChannel ID or name (defaults to globalArgs.defaultChannel).
textstringPlain-text fallback shown in notifications and accessibility tools.
blocksarrayArray of Block Kit block objects.
threadTs?stringParent message ts to reply in a thread.
fn sendWithFiles(channel?: string, text: string, blocks: array, files: array, threadTs?: string)
Post a Block Kit message, then upload local files and share them as a thread reply under that message. Result: one thread containing the alert message followed by the file attachments. Slack's API does not support embedding files directly inside a Block Kit message, so the files land as a sibling thread reply (never as a top-level channel post).
ArgumentTypeDescription
channel?stringChannel ID or name (defaults to globalArgs.defaultChannel).
textstringPlain-text fallback shown in notifications.
blocksarrayBlock Kit blocks for the message body.
filesarrayFiles to upload and attach as a thread reply under the posted message.
threadTs?stringOptional outer thread ts. When set, both the Block Kit message and the file attachments are placed inside that existing thread.
fn verifyAuth()
Call auth.test to confirm the bot token works. Useful after vault setup.

Resources

slackMessage(14d)— Audit record of a posted Slack message: channel, ts, file count, success.
authCheck(7d)— Result of an auth.test verification call.
04Stats
A
100 / 100
Downloads
1
Archive size
10.1 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types1/1earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License declared1/1earned
  • Verified public repository2/2earned
05Platforms