A bot for managing duty schedules and shifts in IT teams, working simultaneously in Telegram and Slack with identical commands.
- Multi-platform: Telegram and Slack support.
- Duty & Shifts: Manage simple daily duties or complex shift-based schedules.
- Escalation: Multi-level escalation (Team Lead -> CTO) with automatic timeouts.
- Automation: Daily digests, reminders, and Google Calendar synchronization.
- Interactive UI: Telegram Mini App with a calendar view and an Admin Panel.
-
Clone & Prepare:
git clone <repo_url> && cd duty_bot cp .env.example .env
-
Generate Security Keys:
# Required for encrypting sensitive data and session security python scripts/generate_security_keys.py --output .env.security cat .env.security >> .env rm .env.security
-
Configure: Fill in your
TELEGRAM_TOKENandSLACK_BOT_TOKENin.env. -
Launch:
docker-compose up -d
Access the Admin Panel at http://localhost:8000
| Category | Command | Description |
|---|---|---|
| Duty | /duty [team] |
Show who is on duty today |
| Team | /team list |
List all teams |
/team add-member <team> @user |
Add member to team | |
| Schedule | /schedule <team> set <date> @user |
Set duty for a specific date/range |
| Shift | /shift <team> add <date> @user |
Add user to a specific shift |
| Escalation | /escalate <team> |
Manually escalate to team lead |
/escalate ack |
Acknowledge/resolve current incident |
For full command list and date formats, see the Commands Documentation.
Key environment variables in .env:
| Variable | Description |
|---|---|
TELEGRAM_TOKEN |
Bot token from @BotFather |
SLACK_BOT_TOKEN |
Bot token starting with xoxb- |
DATABASE_URL |
PostgreSQL connection string |
TIMEZONE |
Timezone for tasks (default: UTC) |
MORNING_DIGEST_TIME |
Time for daily digest (default: 09:00) |
ENCRYPTION_KEY |
Required. Encrypts sensitive data in DB |
- Telegram Mini App: Configure
VITE_TELEGRAM_BOT_USERNAMEand set the Menu Button in @BotFather. - Google Calendar: Setup a Service Account in Google Cloud and upload the JSON key in the Admin Panel.
- Service Configuration: See the Service Setup Guide for step-by-step external integration details.
- Manual Setup: See the project structure and setup instructions for non-docker installation.
The system automatically handles:
- Morning Digest: Daily duty overview.
- Auto-escalation: Level 2 escalation after
ESCALATION_TIMEOUT_MINUTES. - Google Sync: Synchronizes schedules every 4 hours.
- Monthly Stats: Recalculates performance metrics on the 1st of each month.