A Slack bot that crowdsources group availability and automatically finds optimal meeting times. Just use /event start and let the bot collect responses, process them through QC, and aggregate the best options!
- Simple Commands:
/event startto begin tracking availability - Automatic Scraping: Collects messages from the channel automatically
- Smart Parsing: Extracts time preferences from natural language
- Quality Control: Validates and flags problematic responses
- Optimal Aggregation: Finds the best overlapping times across all participants
- Real-time Updates: Posts results as they're discovered
Note: We're working on getting this app published to the Slack App Directory, but the approval process takes time. In the meantime, you can install the app manually by following the instructions below.
- Go to api.slack.com/apps
- Click "Create New App" β "From scratch"
- Name your app (e.g., "Event Availability Aggregator")
- Select your workspace
Bot Token Scopes (OAuth & Permissions β Scopes):
app_mentions:readchannels:historychannels:readchat:writecommandsgroups:historyim:historyim:readmpim:historympim:readusers:read
- Go to Socket Mode in your app settings
- Toggle "Enable Socket Mode" ON
- Create an app-level token with
connections:writescope - Copy the token (starts with
xapp-)
- Go to Slash Commands in your app settings
- Click "Create New Command"
- Fill in:
- Command:
/event - Request URL: (leave empty for Socket Mode)
- Short description: "Start tracking event availability"
- Usage hint:
start | status | stop
- Command:
- Important: Make sure "Escape channels, users, and links sent to your app" is checked (this helps with security)
- Save
- Go to Install App (or OAuth & Permissions)
- Click "Install to Workspace"
- Authorize the app
- Important: After installing, the slash command should be available to ALL users in your workspace. If other users can't see
/event, try:- Reinstalling the app to the workspace (uninstall and reinstall)
- Making sure the app is installed at the workspace level, not just for your user
- Asking other users to refresh their Slack client or restart the app
Install the required dependencies for the backend:
# Node.js dependencies
npm install
# Python dependencies
pip install -r requirements.txtYou'll need to set up environment variables. After creating and installing the app, you can find these tokens in your app's settings:
- Go to api.slack.com/apps
- Select your "Event Availability Aggregator" app
- Navigate to OAuth & Permissions to find your Bot Token
- Navigate to Basic Information β App Credentials to find your Signing Secret
- Navigate to Socket Mode to find your App-Level Token (if using Socket Mode)
Create a .env file:
SLACK_BOT_TOKEN=xoxb-your-bot-token
SLACK_SIGNING_SECRET=your-signing-secret
SLACK_APP_TOKEN=xapp-your-app-token # For Socket Mode
OPENAI_API_KEY=your-openai-key # Required for LLM aggregation
OPENAI_MODEL=gpt-4o-mini # Optional, defaults to gpt-4o-miniOr export them:
export SLACK_BOT_TOKEN="xoxb-your-bot-token"
export SLACK_SIGNING_SECRET="your-signing-secret"
export SLACK_APP_TOKEN="xapp-your-app-token"
export OPENAI_API_KEY="your-openai-key"
# Optional override
export OPENAI_MODEL="gpt-4o-mini"Development Mode:
npm run devProduction Mode (with PM2):
npm run pm2:startFor more information on PM2 deployment, see the Deployment with PM2 section below.
In any Slack channel:
/event start
The bot will respond and start tracking availability messages.
Team members can respond in natural language:
I'm free after 7pm on Saturday
Available Saturday morning
Free anytime Saturday afternoon
Can do 2pm - 5pm
The bot automatically parses these and finds overlaps.
/event status
Shows current progress and optimal times found so far.
/event stop
Stops tracking and posts final results.
-
Organizer:
/event start- Bot: "π Event tracking started! I'm now collecting availability preferences..."
-
Team members respond:
- "Free after 7pm Saturday"
- "Available Saturday morning"
- "Can do 2pm - 5pm Saturday"
-
Bot automatically:
- Scrapes messages
- Parses time slots
- Runs QC validation
- Aggregates overlaps
- Posts updates: "π Update: Found 2 optimal time(s)! π― Best so far: 19:00 - 20:00 (3 people)"
-
Organizer:
/event status- Shows all optimal times with participant lists
-
Organizer:
/event stop- Posts final results: "β Event Complete! π― Best Time: 19:00 - 20:00"
Slack Channel
β
Bot Handler (/event start)
β
Message Scraping (SlackIntegration)
β
Parsing & Normalization (Parser)
β
Quality Control (Python QC Module)
β
Aggregation (OpenAI LLM Aggregation)
β
Results Posted to Slack
sync/
βββ src/
β βββ slack/ # Slack API integration
β βββ bot/ # Bot command handlers
β βββ parsing/ # Message parsing
β βββ qc/ # Quality control (Python)
β βββ aggregation/ # Aggregation (Python) - DEPRECATED, not used
β βββ processing/ # TypeScript-Python bridge for QC, OpenAI LLM for aggregation
β βββ types/ # Type definitions
βββ data/
β βββ processing/ # Temporary processing files (JSON inputs/outputs for QC & aggregation)
βββ package.json
βββ requirements.txt
βββ README.md
npm run devnpm run build
npm startThis application is deployed using PM2, a production process manager for Node.js applications. PM2 keeps the application running in the background, automatically restarts it if it crashes, and provides useful monitoring tools.
Install PM2 globally if you haven't already:
npm install -g pm2Build the project and start it with PM2:
npm run pm2:startThis will:
- Build the TypeScript code to JavaScript
- Start the application using PM2 with the configuration in
ecosystem.config.cjs - Run the bot in production mode
Check Status:
npm run pm2:status
# or
pm2 statusView Logs:
npm run pm2:logs
# or
pm2 logs sync-slack-botRestart the Application:
npm run pm2:restart
# or
pm2 restart sync-slack-botStop the Application:
npm run pm2:stop
# or
pm2 stop sync-slack-botDelete from PM2:
npm run pm2:delete
# or
pm2 delete sync-slack-botThe PM2 configuration is defined in ecosystem.config.cjs. The application is configured to:
- Run in production mode
- Auto-restart on crashes (up to 10 times)
- Log errors and output to
./logs/pm2-error.logand./logs/pm2-out.log - Restart if memory usage exceeds 500MB
- Run a single instance in fork mode
PM2 provides several useful monitoring commands:
# Real-time monitoring
pm2 monit
# View detailed information
pm2 show sync-slack-bot
# View logs with timestamps
pm2 logs sync-slack-bot --timestamppython src/qc/quality_control.py input.json output.json
python src/aggregation/aggregate.py qc_output.json agg_output.json- Check that the bot is installed to your workspace
- Verify environment variables are set correctly
- Check bot token has correct scopes
- Make sure the bot is running (check PM2 status or logs)
- Ensure bot has
channels:historyscope - Make sure bot is in the channel (invite with
/invite @YourBot) - Check that
/event startwas used first
# Verify Python is installed
python3 --version
# Reinstall dependencies
pip install -r requirements.txt| Variable | Description | Required |
|---|---|---|
SLACK_BOT_TOKEN |
Bot User OAuth Token (starts with xoxb-) |
Yes |
SLACK_SIGNING_SECRET |
Signing Secret from app settings | Yes |
SLACK_APP_TOKEN |
App-Level Token for Socket Mode (starts with xapp-) |
Recommended |
OPENAI_API_KEY |
OpenAI API key used for LLM aggregation | Yes |
OPENAI_MODEL |
Override model name (default gpt-4o-mini) |
Optional |
PORT |
HTTP server port (if not using Socket Mode) | Optional |
- Ethan - Slack Integration (ethanxia@seas.upenn.edu)
- Omar - QC (pareja@seas.upenn.edu)
- Eshaan - Aggregation (ekaipa@seas.upenn.edu)