A comprehensive Telegram customer support bot built with Pyrogram that provides advanced ticket management, channel button integration, business hours management, and enterprise-grade features.
- π« Advanced Ticket Management: Create, assign, and track support tickets with sophisticated routing
- π Channel Button Integration: Add support buttons to Telegram channels automatically
- ποΈ Token-Based Activation: Generate activation tokens to enable bot features in groups
- π Business Hours Management: Set operating hours and timezone-aware responses
- π PrivateBin Integration: Secure paste functionality for sensitive data
- π’ Enterprise Features: Advanced channel management, custom limits, and business branding
- π‘οΈ Automated Channel Verification: Secure channel linking with verification system
- β° Scheduled Cleanup: Automatic removal of unverified channels after 24 hours
- π Multi-language Support: Translation capabilities with language detection
- π¦ File Security: VirusTotal integration for security scanning
- π Statistics & Analytics: Comprehensive usage tracking and reporting
- π¦ Advanced Rate Limiting: Configurable anti-spam protection with business hours awareness
- Python 3.12 or higher
- Telegram Bot API credentials
- Database (PostgreSQL recommended for production)
# Clone the repository
git clone https://github.com/Atlas-Projects/XyroSupportBot
cd XyroSupportBot
# Install the bot
nix profile install .
# Run the bot
XyroSupport# Build and run with Docker Compose
docker-compose up -d# Install dependencies
poetry install
# Activate virtual environment
poetry shell
# Run the bot
python -m XyroSupport- Copy the sample configuration:
cp sample_config.yml config.yml- Edit
config.ymlwith your settings:
telegram:
api_id: 12345678 # Get from my.telegram.org
api_hash: "your_api_hash" # Get from my.telegram.org
group_id: -1001234567890 # Your support group ID
bot_token: "123456:ABC-DEF..." # Bot token from @BotFather
owner_id: 123456789 # Your Telegram user ID
database:
schema: "postgresql://user:pass@localhost/dbname"
enterprise:
max_chat_allowed: 20 # Maximum channels for premium
business_name: "Your Business Name"
private_bin_url: "https://paste.example.com"- Set up your database and run the bot.
When you first run the bot, it automatically generates a unique activation token for the bot owner. Use this token to activate the bot in your Telegram groups:
- Run the bot for the first time
- Check the bot logs or use
/subscriptioncommand (if you're the owner) - Copy your activation token
- Add the bot to your Telegram group as an administrator
- Send
/activate <your_token>in the group - The bot will be activated and ready to use
- Use
/subscriptionto view your activation tokens - Use
/deactivate <token>to deactivate from a group - Each token can be used in multiple groups (with configurable limits)
The comprehensive wiki covers:
- π Complete Feature Overview
- π§ Installation & Configuration Guide
- πΌ Channel Button System Setup
- π Business Hours Configuration
- ποΈ Token Activation Guide
- π³ Deployment Instructions
- π Security Considerations
- π οΈ Troubleshooting Guide
Automatically add "Create a Ticket" buttons to your Telegram channels:
- Secure verification system with unique codes
- Automatic button addition to all posts
- Support for multiple channels per group
- Automatic cleanup of unverified channels
The bot uses a token system to enable features in groups:
- Default Limits: 1 channel button, 8 active tickets, 5 assigned tickets
- With Token: Up to 20 channel buttons, unlimited tickets, media support, business hours
Set your operating hours for better customer service:
- Timezone-aware scheduling
- Different hours for different days
- Integration with automated responses
- Language: Python 3.12+
- Framework: Pyrogram (Telegram Bot API)
- Database: SQLAlchemy 2.0 with Alembic migrations
- Task Scheduling: APScheduler
- Package Management: Poetry
- Deployment: Nix flakes and Docker support
# Build the image
docker build -t xyrosupport .
# Run with environment variables
docker run -d --name xyrosupport \
-v $(pwd)/config.yml:/app/config.yml \
xyrosupportCreate a user systemd service at ~/.config/systemd/user/xyrosupport@.service:
[Unit]
Description=XyroSupport Service for %i
After=network.target
[Service]
Type=simple
WorkingDirectory=/path/to/instances/%i
ExecStart=bash -c "sleep 5 && /path/to/.nix-profile/bin/XyroSupport --config /path/to/instances/%i/config.yml"
Restart=on-failure
Environment=SERVICE_NAME=xyrosupport@%i
[Install]
WantedBy=default.targetEnable and start:
systemctl --user daemon-reload
systemctl --user enable xyrosupport@your-instance
systemctl --user start xyrosupport@your-instanceWe welcome contributions! Please see our contributing guidelines in the wiki.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the GPL v3 License - see the LICENSE file for details.
- π Documentation: Check the Wiki first
- π Issues: Report bugs on GitHub
- π Full Wiki Documentation
- π³ Docker Hub
- π¦ PyPI Package
XyroSupportBot - Professional customer support made simple on Telegram.