Automated Slack bot for IT Service Desk ticket category reminders
A Slack bot that monitors your IT Service Desk channel and automatically reminds users to select a category for their tickets when they forget to do so.
Features β’ Quick Start β’ Configuration β’ Contributing
| Feature | Description |
|---|---|
| π Automatic Monitoring | Continuously monitors your Slack channel for new tickets |
| β° Smart Timing | Only reminds users after a configurable time threshold |
| π€ HelpDesk Integration | Detects when HelpDesk bot has already processed a ticket |
| π Duplicate Prevention | Tracks reminded messages to avoid spamming users |
| π³ Docker Ready | Fully containerized with multi-architecture support (Intel & Apple Silicon) |
| π Secure | Runs as non-root user, credentials via environment variables |
# Clone the repository
git clone https://github.com/CaputoDavide93/ITSD-Reminder.git
cd ITSD-Reminder
# Configure environment
cp config/.env.example config/.env
nano config/.env # Add your Slack credentials
# Run with Docker
docker compose up -d| Requirement | Version |
|---|---|
| π³ Docker | 20.10+ |
| π¦ Docker Compose | 2.0+ |
| Requirement | Version |
|---|---|
| π Python | 3.9+ |
| π¦ pip | Latest |
π Step-by-Step Guide
- Go to api.slack.com/apps
- Click "Create New App" β "From scratch"
- Enter an App Name (e.g., "ITSD Reminder Bot")
- Select your workspace and click "Create App"
- Navigate to "OAuth & Permissions"
- Add these Bot Token Scopes:
| Scope | Purpose |
|---|---|
channels:history |
Read messages from public channels |
channels:read |
View basic channel info |
chat:write |
Send reminder messages |
users:read |
Get user information for mentions |
- Click "Install to Workspace"
- Review permissions and click "Allow"
- Copy the Bot User OAuth Token (starts with
xoxb-)
- Open your IT Service Desk channel in Slack
- Type
/invite @YourBotName
| Variable | Required | Default | Description |
|---|---|---|---|
SLACK_BOT_TOKEN |
β | - | Your Slack Bot OAuth Token |
CHANNEL_ID |
β | - | The Slack channel ID to monitor |
HELPDESK_BOT_ID |
β | - | The HelpDesk bot's ID |
AGE_THRESHOLD_SECONDS |
β | 10800 |
Time to wait before sending reminder (3 hours) |
CHECK_INTERVAL_HOURS |
β | 2 |
How often to check for new messages |
# config/.env
SLACK_BOT_TOKEN=xoxb-your-token-here
CHANNEL_ID=C0XXXXXXXXX
HELPDESK_BOT_ID=B0XXXXXXXXX
AGE_THRESHOLD_SECONDS=10800
CHECK_INTERVAL_HOURS=2
β οΈ Security Note: Never commit your.envfile to version control!
This image supports both Intel/AMD64 and Apple Silicon (ARM64).
# Build and start
docker compose up -d
# View logs
docker compose logs -f
# Stop the service
docker compose down
# Rebuild after code changes
docker compose up -d --build# Create virtual environment
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Set environment variables
export SLACK_BOT_TOKEN="xoxb-your-token"
export CHANNEL_ID="C0XXXXXXXXX"
export HELPDESK_BOT_ID="B0XXXXXXXXX"
# Run the bot
python src/main.pyβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ITSD Reminder Bot β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β 1. π Fetches today's messages from the channel β
β β β
β 2. β° Filters messages older than threshold β
β β β
β 3. π Checks each thread for HelpDesk bot replies β
β β β
β 4. π¨ Sends reminder to threads without category β
β β β
β 5. πΎ Logs reminded messages to prevent duplicates β
β β β
β 6. π΄ Sleeps for configured interval, then repeats β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ITSD-Reminder/
βββ π src/ # Source code
β βββ __init__.py
β βββ main.py # Main bot logic
βββ π config/ # Configuration
β βββ .env.example # Template (safe to commit)
β βββ .env # Your secrets (gitignored)
βββ π data/ # Runtime data (gitignored)
β βββ reminded_messages.json
βββ π³ Dockerfile # Multi-arch Docker image
βββ π³ docker-compose.yml # Docker orchestration
βββ π requirements.txt # Python dependencies
βββ π LICENSE # MIT License
βββ π€ CONTRIBUTING.md # Contribution guidelines
βββ π SECURITY.md # Security policy
βββ π README.md # This file
β Bot not responding
- Check if the bot is running:
docker compose ps - Verify logs for errors:
docker compose logs -f - Ensure environment variables are set correctly
β "channel_not_found" error
- Verify the
CHANNEL_IDis correct - Ensure the bot is invited to the channel:
/invite @YourBotName
β Messages not being detected
- Check
AGE_THRESHOLD_SECONDS- messages must be older than this value - Verify the bot has
channels:historypermission
Contributions are welcome! Please read our Contributing Guide for details.
- π΄ Fork the repository
- πΏ Create a feature branch (
git checkout -b feature/amazing-feature) - πΎ Commit your changes (
git commit -m 'Add amazing feature') - π€ Push to the branch (
git push origin feature/amazing-feature) - π Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.