SlackBot WS
The only thing left is the fun stuff.
A production-ready Slack bot framework for Elixir, built for Socket Mode.
defmodule MyApp.SlackBot do
use SlackBot, otp_app: :my_app
handle_event "message", event, _ctx do
SlackBot.push({"chat.postMessage", %{
"channel" => event["channel"],
"text" => "Hello!"
}})
end
end
A grammar-driven DSL that turns Slack interactions into clean, testable Elixir code.
See more in actionWhy Socket Mode?
Real-time event delivery without the operational overhead of webhooks.
No Public Endpoints
Works behind firewalls without exposing HTTP endpoints
Low Latency
Persistent connections for real-time event delivery
Local Development
No ngrok or tunnel required during development
Interactive Payloads
Full support for modals, shortcuts, and actions
Everything You Need for Production Bots
SlackBot WS handles the operational complexity so you can focus on building features.
Resilience & Reliability
Built to stay online
Resilient Connection
Supervised transport with automatic backoff, jittered retries, deduplication, and heartbeats. Your bot stays online.
Tier-Aware Rate Limiting
Per-channel and per-workspace shaping with Slack's published tier quotas enforced automatically.
Production Defaults
Add tokens, supervise the module, and you have heartbeats, backoff, and rate limiting without config.
Developer Experience
SlackBot WS's developer ergonomics makes it a joy to build features.
Declarative Slash Grammar
Compile-time DSL for deterministic command parsing. No regex piles—just structured maps.
Plug-like Middleware
Compose pipelines with handle_event, slash, and middleware macros instead of sprawling case statements.
Native Interactivity
Shortcuts, message actions, block suggestions, and modal submissions all flow through the same pipeline.
AI-Pair Ready
Ships with AGENTS.md so your dev agents understand SlackBot WS's features and idioms.
Scalability & Observability
Ready for production
Task-Based Fan-out
Handlers run in supervised tasks so slow commands never block the socket loop.
Pluggable Adapters
ETS cache by default, swap to Redis for multi-node. Configure cache sync and assigns like :bot_user_id.
Full Observability
Telemetry spans, diagnostics ring buffer with replay, and LiveDashboard-ready metrics out of the box.
Powerful & Expressive
See how simple it is to build production-ready Slack bots with SlackBot WS.
defmodule MyApp.SlackBot do
use SlackBot, otp_app: :my_app
# /deploy api → %{service: "api"}
# /deploy api canary → %{service: "api", canary?: true}
slash "/deploy" do
value :service
optional literal("canary", as: :canary?)
repeat do
literal "env"
value :envs
end
handle payload, ctx do
%{service: svc, envs: envs} = payload["parsed"]
Deployments.kick(svc, envs, ctx)
end
end
end
Input → Output:
/deploy api
→
%{service: "api"}
/deploy api canary env staging
→
%{service: "api", canary?: true, envs: ["staging"]}