A Telegram bot that monitors your GitHub repositories and sends notifications about:
- Pull Requests
- Issues
- Releases
repository-monitor/
βββ cmd/
β βββ monitor/
β βββ main.go # Application entry point
βββ internal/
β βββ bot/
β β βββ handler.go # Telegram bot command handlers
β β βββ telegram.go # Telegram bot implementation
β βββ github/
β β βββ client.go # GitHub client
β β βββ notifications.go # GitHub notifications logic
β βββ models/
β β βββ account.go # GitHub account model
β β βββ notification.go # Notification models
β β βββ user.go # User model
β βββ store/
β β βββ postgres/
β β β βββ store.go # PostgreSQL implementation
β β βββ store.go # Store interface
β βββ config/
β βββ config.go # Configuration management
βββ .env.example # Example environment variables
βββ docker-compose.yml # Docker Compose configuration
βββ Dockerfile # Docker build configuration
βββ README.md # This file
- Monitor multiple GitHub accounts
- Receive notifications for:
- New or updated Pull Requests
- New or updated Issues
- New Releases
- Toggle notifications per GitHub account
- Configurable notification intervals
- Persistent storage using PostgreSQL
- Go 1.19 or higher
- PostgreSQL database
- Telegram bot token (get it from @BotFather)
Copy .env.example to .env and configure the following variables:
TELEGRAM_TOKEN: Your Telegram bot tokenPOSTGRES_URL: PostgreSQL connection URLRENOTIFY_INTERVAL: Hours to wait before re-notifying about the same item (default: 24)NOTIFY_INTERVAL: Minutes between GitHub checks (default: 5)POLLING_TIMEOUT: Seconds for Telegram long polling timeout (default: 60)DEBUG: Enable debug logging (default: false)
- Configure environment variables in
.env - Run with Docker Compose:
docker-compose up -d
-
Clone the repository:
git clone https://github.com/erkineren/repository-monitor.git cd repository-monitor -
Install dependencies:
go mod download
-
Configure environment variables in
.env -
Run the application:
go run cmd/monitor/main.go
/start- Show welcome message and available commands/add <username> <token>- Add a GitHub account to monitor/remove <username>- Remove a GitHub account/toggle <username>- Toggle notifications for a GitHub account/list- List monitored GitHub accounts/help- Show help message
The project follows standard Go project layout and best practices:
- Code is organized into packages by functionality
- Dependencies are managed with Go modules
- Configuration is handled through environment variables
- Business logic is separated from infrastructure concerns
- Interfaces are used for dependency injection and testing
Contributions are welcome! Here's how you can contribute:
- Fork the repository
- Create a new branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests to ensure everything works
- Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please make sure to update tests as appropriate and adhere to the existing coding style.
If you discover a security vulnerability within this project, please send an email to erkineren@gmail.com. All security vulnerabilities will be promptly addressed.
This project is licensed under the MIT License - see the LICENSE file for details.