pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/redis-developer/chat-sdk-slackbot-distributed-locking

mer-70be7debc79a8eff.css" /> GitHub - redis-developer/chat-sdk-slackbot-distributed-locking: A Slack support triage bot that uses Chat SDK for webhook normalization, Redis for coordination and state persistence, and OpenAI (optionally) for AI-powered issue classification. · GitHub
Skip to content

redis-developer/chat-sdk-slackbot-distributed-locking

Repository files navigation

Slack support triage bot with Chat SDK and Redis

This repo is a sample app for a Slack support triage bot that:

  • Uses chat, @chat-adapter/slack, and @chat-adapter/state-redis
  • Persists thread subscriptions and triage state in Redis
  • Prevents duplicate replies when Slack retries events
  • Coordinates multiple workers with Redis-backed per-thread leases

Quickstart

npm i -g localtunnel
pnpm install
cp .env.example .env.local
docker compose up -d redis
pnpm dev
lt --port 3000

Open http://localhost:3000 for setup instructions.

Environment variables

See .env.example.

  • REDIS_URL is required.
  • SLACK_BOT_TOKEN and SLACK_SIGNING_SECRET are required for the live Slack webhook.
  • OPENAI_API_KEY is optional. Without it, the app falls back to a deterministic heuristic analyzer.
  • OPENAI_MODEL defaults to gpt-4.1-mini.

Slack app setup

  1. Open the Slack app manifest flow.
  2. Paste slack-manifest.yml.
  3. Replace https://your-domain.com/api/webhooks/slack with your public webhook URL.
  4. Install the app and copy the bot token and signing secret into .env.local.

The sample uses one webhook route:

  • POST /api/webhooks/slack

Commands and actions

The primary UX is the triage card buttons:

  • Hand off to human
  • Close triage

Optional slash commands are included for demo completeness:

  • /triage-status slack:C123:1710000000.000100
  • /triage-handoff slack:C123:1710000000.000100
  • /triage-close slack:C123:1710000000.000100

Tests

pnpm test
pnpm lint

The test suite covers the Redis-backed control path:

  • Slack event idempotency
  • Per-thread lease expiry and takeover
  • New triage replies and follow-up updates
  • Human handoff and close behavior

Docker

Run the full stack with:

docker compose up -d --build

This starts:

  • The Next.js app on http://localhost:3000
  • Redis on redis://localhost:6379

About

A Slack support triage bot that uses Chat SDK for webhook normalization, Redis for coordination and state persistence, and OpenAI (optionally) for AI-powered issue classification.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy