Note: I made this bot in 24 hours as my proof-of-work
- Slash Command:
/bluma-bot generate video for [product] highlighting [feature] - AI-Powered: Uses GPT-4 for video concepts and Sora-2 for video generation
- Fast Response: Video ideas generated instantly, videos within 5 minutes
- Slack Integration: Native Slack experience with rich formatting
- Vercel account (recommended) or AWS account
- Slack workspace with admin access
- OpenAI API key with Sora-2 access
Create a .env file with the following variables:
# Slack Bot Configuration
BotToken=xoxb-your-bot-token-here
SigningSecret=your-signing-secret-here
ClientSecret=your-client-secret-here
# OpenAI Configuration
BlumaAPI=your-openai-api-key-here# Install Vercel CLI
npm install -g vercel
# Deploy
vercel --prod
# Set environment variables in Vercel dashboard
# Go to your project settings and add the environment variables- Connect your GitHub repository to Vercel
- Import the project
- Add environment variables in project settings
- Deploy
-
Go to Slack API Apps
-
Select your existing Bluma app
-
Navigate to Slash Commands
-
Add a new command:
- Command:
/bluma-bot - Request URL:
https://your-vercel-app.vercel.app/api/slack - Short Description: Generate viral video content
- Usage Hint:
generate video for [product] highlighting [feature]
- Command:
-
Navigate to OAuth & Permissions
-
Add these Bot Token Scopes:
commands- For slash commandschat:write- To send messagesapp_mentions:read- To handle mentions
-
Navigate to Event Subscriptions
-
Enable Events and set Request URL:
https://your-vercel-app.vercel.app/api/slack -
Subscribe to bot events:
app_mention
- Go to Install App in your Slack app settings
- Install to your workspace
- Copy the Bot User OAuth Token to your
.envfile asBotToken
In your Slack workspace:
/bluma-bot generate video for CRM Software highlighting automated lead scoring
Expected behavior:
- Immediate acknowledgment
- Video idea generated and shared
- Video creation starts
- Final video shared (within 5 minutes)
-
"Command not found"
- Check if slash command is properly configured
- Verify Request URL is correct
-
"Bot not responding"
- Check Vercel deployment logs
- Verify environment variables are set
- Check OpenAI API key validity
-
"Video generation failed"
- Verify Sora-2 model access
- Check OpenAI API rate limits
- Review error logs in Vercel
-
Check Vercel Logs:
vercel logs your-deployment-url
-
Test Locally:
# Activate virtual environment source venv/bin/activate # Start local server python api/slack.py
-
Monitor API Usage:
- Check OpenAI dashboard for usage
- Monitor Slack API rate limits
pip install -r requirements.txt
python api/slack.py├── api/
│ ├── config.py # Configuration module
│ ├── requirements.txt # Python dependencies
│ └── slack.py # Main bot handler
├── .cursor/rules/ # Development guidelines
├── package.json # Node.js configuration
├── .vercelignore # Vercel ignore file
└── README.md # This file