Skip to content
Misar.io

How to Create a Slack Bot with AI in 2026 (Step-by-Step Guide)

All articles
Guide

How to Create a Slack Bot with AI in 2026 (Step-by-Step Guide)

Build a Slack bot with slash commands, interactive messages, and AI responses using Bolt for JavaScript — deploy in one afternoon.

Misar Team·May 13, 2025·3 min read
How to Create a Slack Bot with AI in 2026 (Step-by-Step Guide)
Photo by Ann H on pexels
Table of Contents

Quick Answer

Use Slack's Bolt framework with Node.js, scaffold with Claude Code, and deploy to a VPS or Socket Mode for dev. Supports slash commands, shortcuts, events, and Block Kit interactive UI.

  • Time to deploy: 3-5 hours
  • Cost: $0 (Socket Mode) to $5/mo (HTTP + VPS)
  • Stack: Bolt JS, Node.js, Block Kit

What You'll Need

  • Slack workspace with admin rights
  • Node.js 20+, pnpm
  • Cursor or Claude Code
  • VPS or Fly.io (or Socket Mode for no hosting)

Steps

  1. Create the app. Go to api.slack.com/apps → Create New App → From scratch. Name it, pick workspace.
  2. Enable Socket Mode (easiest for dev). OAuth & Permissions → add scopes: commands, chat:write, app_mentions:read. Socket Mode → generate App-Level Token with connections:write.
  3. Scaffold with AI. pnpm add @slack/bolt dotenv. Prompt: "Create a Bolt JS app with Socket Mode. Add handlers for /ask slash command, app_mention events, and a button action using Block Kit."
  4. Build Block Kit UI. Use Block Kit Builder. Ask AI: "Generate a Block Kit JSON with a section, divider, and two buttons for approve/reject."
  5. Handle interactivity. Button clicks hit app.action('approve_btn', ...). Always await ack() within 3 seconds or Slack shows error.
  6. Add AI responses. Route /ask to your AI backend. Stream long responses as message edits (client.chat.update).
  7. Install to workspace. Install App → approve scopes. Token goes into your .env.
  8. Deploy. Socket Mode works from any laptop. For production, switch to HTTP mode, deploy to Fly.io, configure Request URL.

Common Mistakes

  • Not acking within 3s: Slack retries and your handler runs multiple times.
  • Blocking the event loop: Offload heavy work with setImmediate or a queue.
  • Wrong scopes: Re-installation required when you add scopes.
  • Ignoring retry headers: Handle X-Slack-Retry-Num to avoid duplicate processing.
  • Public bot without verification: Slack requires marketplace review.

Top Tools

ToolBest ForPrice
Bolt JSOfficial Slack frameworkFree
Block Kit BuilderVisual UI designerFree
Socket ModeNo hosting neededFree
Fly.ioFree-tier hosting$0-5
ngrokLocal HTTP devFree tier

Conclusion

Slack bots automate team workflows that would otherwise cost hours. Start with Socket Mode, build one useful command, then iterate. Internal bots don't need marketplace review — ship today.

slack-botbolt-jsai-codingblock-kitautomation
Enjoyed this article? Share it with others.

More to Read

View all posts
Guide

Safely Train AI Chatbots on Website Content in 2026

Website content is one of the richest sources of information your business has. Every help article, FAQ, service description, and policy page is a direct line to your customers’ most pressing questions—yet most of this d

9 min read
Guide

E-commerce AI Assistants 2026: How to Drive Revenue with AI

E-commerce is no longer just about transactions—it’s about personalized experiences, instant support, and frictionless journeys. Today’s shoppers expect more than just a website; they want a concierge that understands th

10 min read
Guide

5 Must-Have Features for a Healthcare AI Assistant in 2026

Healthcare AI isn’t just about algorithms—it’s about trust. Patients, clinicians, and regulators all need to believe that your AI assistant will do more than talk; it will listen, remember, and act responsibly when it ma

11 min read
Guide

Best AI Chat Widgets for SaaS Conversions in 2026: Boost Leads Now

Website AI chat widgets have become a staple for SaaS companies looking to engage visitors, answer questions, and drive conversions. Yet, most chat widgets still rely on generic, rule-based bots that frustrate users with

11 min read

Explore Misar AI Products

From AI-powered blogging to privacy-first email and developer tools — see how Misar AI can power your next project.

Stay in the loop

Follow our latest insights on AI, development, and product updates.