Skip to content

Slack Bot Documentation

Setup instructions are in the Complete Setup Guide.

Source Structure

slack/src/
├── app.ts                     # Entry point, Bolt app init, handler registration
├── constants/                 # All IDs and strings (no magic strings)
│   ├── action_ids.ts          # Button/action IDs + prefixes
│   ├── block_ids.ts           # Block IDs + input action IDs
│   ├── view_ids.ts            # Modal callback IDs
│   ├── homeTab.ts             # Home tab text (Dutch), modes, pagination
│   └── index.ts               # Re-exports
├── handlers/
│   ├── events.ts              # app_home_opened
│   ├── shortcuts.ts           # Message + global shortcuts
│   ├── actions.ts             # Main action router
│   ├── submissions.ts         # Main submission router
│   ├── home/                  # Dynamic App Home rendering
│   ├── actions/               # categorySettings, distribution, subscription
│   ├── submissions/           # digestHandler
│   └── api/                   # sendDigest endpoint
├── views/                     # Block Kit view builders (modals, home tab)
├── services/                  # Backend API clients
├── utils/                     # API client, logger, helpers
├── middleware/                 # Error handler
├── i18n/                      # Dutch translations
└── types/                     # TypeScript types

Handler Routing

app.event('app_home_opened')      → handlers/events.ts → handlers/home/dynamic.ts
app.view(/.*/)                    → handlers/submissions.ts (routes by callback_id)
app.action(/.*/)                  → handlers/actions.ts (routes by action_id)
app.shortcut('add_to_hub')        → handlers/shortcuts.ts (message shortcut)
app.shortcut('quick_add_knowledge') → handlers/shortcuts.ts (global shortcut)