Skip to content

cyrus-lang/Cyrus-Telegram-Github-Events-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cyrus GitHub Events

A high-performance Rust bot that receives GitHub organization events (stars, issues, PRs, releases, discussions, etc.) and forwards them to a Telegram group with topic support. Beautiful HTML formatting, admin commands, and full Docker support.

Features

  • GitHub Events: Stars/Unstars, Issues (opened/closed/reopened/assigned), Pull Requests (opened/merged/closed), Push (with commit messages), Releases (with markdown notes), Workflow Runs, New Repositories, Discussions
  • Telegram Topics: Each event goes to a specific topic in forum groups
  • Beautiful UI: Rich HTML messages with emojis, bold text, and formatted code blocks
  • User Linking: Link Telegram accounts to GitHub usernames for @mentions
  • Admin Commands: Manage repos, link/unlink users, mute/unmute, discover org
  • Repository Guard: Only monitor specific repositories
  • User Muting: Silence notifications from specific users
  • Auto-Discovery: Scan entire org for repos and contributors
  • SQLite Database: Zero-config, file-based persistence
  • Docker Ready: Multi-stage build, health check, restart policy

Quick Start

1. Prerequisites

2. Configuration

cp .env.example .env
# Edit .env with your values

3. Run with Docker

docker compose up -d --build

4. Run without Docker

cargo run --release

5. Setup GitHub Webhook

On your GitHub organization or repository:

  1. Go to Settings → Webhooks → Add webhook
  2. Payload URL: https://your-server.com/api/webhook/github
  3. Content type: application/json
  4. Secret: Same as GITHUB_WEBHOOK_SECRET in .env
  5. Events: Select "Send me everything"
  6. Add the first repo with /addrepo in Telegram

Configuration

Variable Required Default Description
API_PORT No 8080 HTTP server port
BOT_TOKEN Yes Telegram bot token from BotFather
BOT_CHAT_ID Yes Telegram group/channel numeric ID
BOT_TOPIC_ID No Topic/thread ID for forum groups
BOT_ADMIN_IDS No Comma-separated admin Telegram IDs
BOT_POLLING No true Use polling instead of webhook
GITHUB_TOKEN Yes GitHub personal access token
GITHUB_ORG_NAME Yes GitHub organization name
GITHUB_WEBHOOK_SECRET Yes GitHub webhook secret
DB_FILE_PATH No data/cyrus_events.sqlite SQLite database path

Commands

User Commands

  • /help — Show available commands
  • /listrepos — List monitored repositories
  • /listcontributors — List contributors
  • /whoami — Show your linked GitHub account

Admin Commands

  • /addrepo <url> — Add a repository to monitoring
  • /removerepo <url> — Remove a repository
  • /link <gh-user> [@tg-user] — Link GitHub to Telegram
  • /unlink <@tg-user> — Unlink accounts
  • /mute <gh-user> — Mute notifications from a user
  • /unmute <gh-user> — Unmute a user
  • /discover — Auto-discover org repos and contributors

Architecture

GitHub Webhook → HTTP Server (Axum) → Event Parser → Guards (repo check, mute check)
                                                         ↓
                                                  Telegram Bot (teloxide)
                                                         ↓
                                                  Group/Topic Message

Development

# Build
cargo build

# Run with auto-reload
cargo watch -x run

# Check
cargo check

License

MIT

About

A high-performance Rust bot that monitors GitHub organizations for events (stars, issues, PRs, releases, discussions) and forwards them to Telegram groups with topic/thread support, rich HTML formatting, and admin management commands.

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors