A Slack bot built with Python, Flask, and Slack Bolt
- Daily standup reminders (weekdays at 9:00 AM)
- Weekly deadline alerts (Fridays at 5:00 PM)
- GitHub commit notifications (via command)
/todo add <task>- Add tasks to your personal todo list/todo list- View your current todos/translate <text>- Translate text to English/faq <question>- Get answers to common questions/poll Question | option1, option2, ...- Create interactive polls/github owner/repo- Check recent commits/calendar- View upcoming calendar events/joke- Get a random joke/encourage- Receive motivational messages
- Poll voting with buttons
- Real-time vote tracking
- GitHub API for commit monitoring
- Google Calendar API (mock implementation)
- Translation API (LibreTranslate)
- Joke API for entertainment
- Python 3.8+ installed on your system
- Slack Workspace: Where you can create and install apps
- Slack Bot Token (xoxb-...): From your Slack app's OAuth settings
- Slack Signing Secret: 32-character string from your Slack app
- GitHub Personal Access Token: For
/githubcommand (repo scope) - Google Calendar API Key: For
/calendarcommand
- ngrok or similar tunneling service to expose localhost to Slack
- Python 3.8+
- Flask - Web framework
- Slack Bolt - Slack app framework
- APScheduler - Task scheduling
- Requests - HTTP client for APIs
- Python 3.8 or higher
- A Slack workspace where you can install apps
git clone https://github.com/yourusername/bot-stack.git
cd bot-stackpip install -r requirements.txt- Go to api.slack.com/apps and create a new app
- Add bot token scopes:
chat:write,commands,channels:read,groups:read,im:read,mpim:read - Install the app to your workspace
- Copy the Bot User OAuth Token and Signing Secret
cp .env.example .envEdit .env and add your tokens:
SLACK_BOT_TOKEN=xoxb-your-bot-token-here
SLACK_SIGNING_SECRET=your-signing-secret-here
GITHUB_TOKEN=your-github-personal-access-token (optional)
GOOGLE_CALENDAR_API_KEY=your-google-api-key (optional)
python app.pyThe bot will start on http://localhost:3000.
For Slack to send events to your local server, use ngrok:
# Install ngrok from https://ngrok.com/
ngrok http 3000Copy the ngrok URL (e.g., https://abc123.ngrok.io) and set it as the Request URL in your Slack app's Event Subscriptions: https://abc123.ngrok.io/slack/events
- Connect your GitHub repository to Render
- Set environment variables in Render dashboard
- Deploy with the following settings:
- Runtime: Python 3
- Build Command:
pip install -r requirements.txt - Start Command:
python app.py
- Connect GitHub repo
- Add environment variables
- Railway will auto-detect Python and deploy
The app can be deployed to any platform supporting Python/Flask:
- Heroku
- DigitalOcean App Platform
- AWS Elastic Beanstalk
bot-stack/
├── app.py # Main Flask application with Slack Bolt handlers
├── features.py # Core bot features and API integrations
├── config.py # Configuration and environment variable loading
├── requirements.txt # Python dependencies
├── .env.example # Environment variables template
└── README.md # This file
- SLACK_BOT_TOKEN: Bot user OAuth token from Slack app
- SLACK_SIGNING_SECRET: App signing secret from Slack
- GITHUB_TOKEN: Personal access token for GitHub API (repo scope)
- GOOGLE_CALENDAR_API_KEY: API key for Google Calendar integration
/todo add Review pull request #123
/todo list
/translate Hello, how are you?
/faq how to reset password
/poll What's for lunch? | Pizza, Sushi, Burgers
/github octocat/Hello-World
/calendar
/joke
/encourage
- Add feature functions to
features.py - Create command handlers in
app.py - Update README with new commands
# Run with debug mode
python app.py- Follow PEP 8 style guidelines
- Add docstrings to all functions
- Handle errors gracefully
- Use environment variables for configuration
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
MIT License - feel free to use this project for learning and portfolio purposes.
Built by 0xgordian - ASlack bot called Bot Stack built in Python