-
Notifications
You must be signed in to change notification settings - Fork 1
Implement Slack welcome bot on Cloudflare Workers with stats dashboard #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: DonnieBLT <[email protected]>
…validation Co-authored-by: DonnieBLT <[email protected]>
|
@copilot the message should be sent to the user joining not a channel |
The implementation already sends a direct message (DM) to the joining user, not to a public channel. The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements a comprehensive Slack welcome bot hosted on Cloudflare Workers that automatically sends welcome messages to new workspace members. The implementation includes a stats dashboard with charts, an editable markdown welcome message, and proper security measures including HMAC signature verification.
Key Changes
- Slack Events API integration with
team_joinevent handling and DM sending via Block Kit - Custom markdown-to-Slack blocks parser for flexible message customization
- Stats dashboard with Chart.js visualization, showing total joins, recent activity, and daily trends
- Security implementation with HMAC-SHA256 signature verification and replay attack prevention
Reviewed changes
Copilot reviewed 13 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/index.ts | Main worker with routing, KV persistence, and event handling logic |
| src/slack.ts | Signature verification and welcome message sending functionality |
| src/dashboard.ts | HTML/CSS/JS for the stats dashboard UI |
| src/config.ts | Configuration constants for URLs, TTLs, and validation |
| src/types.ts | TypeScript interfaces for type safety |
| test/slack.test.ts | Tests for markdown-to-Slack blocks conversion |
| test/dashboard.test.ts | Tests for dashboard HTML rendering |
| wrangler.toml | Cloudflare Workers configuration with KV namespace setup |
| package.json | Dependencies including wrangler, vitest, and TypeScript tooling |
| WELCOME_MESSAGE.md | Editable welcome message template with markdown support |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } catch (error) { | ||
| console.error('Error handling Slack event:', error); | ||
| return new Response('Internal Server Error', { status: 500 }); |
Copilot
AI
Nov 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error handling catches and logs the error but returns a generic "Internal Server Error" message. Consider providing more specific error messages (e.g., "Failed to verify signature", "Failed to send welcome message") to help with debugging while being careful not to expose sensitive information.
Slack bot that sends welcome DMs to new workspace members, with an editable markdown welcome message and a stats dashboard tracking join events.
Features
team_joinevents, sends welcome DMs via Block KitWELCOME_MESSAGE.mdconverted to Slack blocks at runtimeArchitecture
Security
Dashboard Preview
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com//advisories/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(http block)sparrow.cloudflare.com/usr/local/bin/node /usr/local/bin/node --no-warnings --experimental-vm-modules /home/REDACTED/work/BLT-Lettuce-on-Cloudflare/BLT-Lettuce-on-Cloudflare/node_modules/wrangler/wrangler-dist/cli.js deploy --dry-run(dns block)/usr/local/bin/node /usr/local/bin/node --no-warnings --experimental-vm-modules /home/REDACTED/work/BLT-Lettuce-on-Cloudflare/BLT-Lettuce-on-Cloudflare/node_modules/wrangler/wrangler-dist/cli.js dev(dns block)/usr/local/bin/node /usr/local/bin/node --no-warnings --experimental-vm-modules /home/REDACTED/work/BLT-Lettuce-on-Cloudflare/BLT-Lettuce-on-Cloudflare/node_modules/wrangler/wrangler-dist/cli.js dev --port 8787(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.