Skip to content

Digix-Team/TimeBaleBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Group Bio Updater Bot - Professional Documentation

Overview

The Group Bio Updater Bot is a sophisticated automation solution designed for Bale messenger that automatically updates group descriptions with real-time Persian time and date information. This enterprise-grade bot features a payment system, customizable bio templates, and efficient resource management for optimal performance.

Technical Architecture

Core Components

  • Asynchronous Processing: Built on asyncio for high-concurrency operations
  • Optimized Database: SQLite with WAL mode and intelligent caching
  • Rate Limiting: Custom lightweight rate limiter for API compliance
  • Memory Management: Automated garbage collection and cache optimization
  • Multi-threading: Dedicated update thread for background operations

Database Design

The bot utilizes SQLite with the following optimizations:

  • Write-Ahead Logging (WAL) mode for better concurrency
  • Strategic indexing on frequently accessed columns
  • Connection pooling and thread-safe operations
  • Intelligent caching layer with TTL management

Key Features

1. Automated Description Updates

  • Real-time Persian time display (12-hour and 24-hour formats)
  • Accurate Persian calendar (Jalali) date updates
  • Configurable update intervals (every minute)
  • Support for custom bio templates

2. Payment System

  • One-time activation fee (15,000 Tomans)
  • Integration with Bale payment providers
  • Support for multiple payment methods
  • Automated payment verification and activation

3. Custom Bio Templates

  • Dynamic variable replacement ({TIME}, {DATE})
  • Case-insensitive variable detection
  • Custom text with bio variables (max 200 characters)
  • Real-time preview functionality

4. Administration & Management

  • Admin-only command access
  • Group status monitoring
  • Activation/deactivation controls
  • Usage statistics and analytics

5. Performance Optimizations

  • Concurrent update processing (10 simultaneous operations)
  • Batch processing for efficient resource utilization
  • Intelligent rate limiting (15 requests/minute)
  • Memory usage optimization and cleanup

System Requirements

Software Dependencies

  • Python 3.8+
  • Bale Bot API library
  • SQLite3
  • Pytz for timezone management
  • jdatetime for Persian calendar

Hardware Requirements

  • Minimum 150MB RAM allocation
  • Stable internet connection
  • Storage for database and logs

Installation & Setup

1. Environment Setup

git clone https://github.com/Digix-Team/TimeBaleBot
cd TimeBaleBot
pip install -r requirements.txt

2. Configuration

  1. Obtain Bale Bot Token from @BotFather
  2. Configure payment provider token
  3. Set activation price and group limits
  4. Adjust performance parameters as needed

3. Database Initialization

The bot automatically creates and optimizes the database on first run:

  • Group information storage
  • Payment records
  • Custom bio templates
  • Usage statistics

Usage Instructions

Basic Commands

Group Administrators

  • /enable - Activate bot (requires payment)
  • /disable - Deactivate bot
  • /setbio [text] - Set custom bio template
  • /removebio - Remove custom bio
  • /status - Check bot status
  • /help - Display help information
  • /about - Show bot information

Private Chat

  • /start - Initial setup guide
  • /help - Detailed documentation
  • /about - Technical specifications
  • Donation support via invoice system

Custom Bio Variables

  • {TIME} - Current Persian time (dual format)
  • {DATE} - Current Persian date
  • Variables are case-insensitive
  • Maximum 200 characters per template

Payment Process

  1. Send /enable command in group
  2. Receive payment invoice
  3. Complete payment via supported methods
  4. Bot automatically activates upon verification
  5. Make bot administrator for full functionality

Performance Characteristics

Scalability

  • Supports up to 300 concurrent active groups
  • Efficient batch processing (20 groups/batch)
  • Optimized database queries with caching
  • Automatic load distribution

Reliability

  • Error handling and recovery mechanisms
  • Connection timeout management
  • Payment verification safeguards
  • Regular backup and cleanup operations

Monitoring

  • Comprehensive logging system
  • Performance metrics tracking
  • Resource usage optimization
  • Automatic error reporting

Security Features

  • Admin-only command execution
  • Secure payment processing
  • SQL injection prevention
  • Input validation and sanitization
  • Secure token management

Limitations

Technical Constraints

  • Maximum 300 active groups simultaneously
  • 200-character limit for custom bios
  • 15 API requests per minute rate limit
  • Bale-specific implementation

Functional Limitations

  • Requires admin privileges in groups
  • Dependent on Bale API availability
  • Persian time/date focus
  • One-time payment model

Support & Maintenance

Error Handling

  • Graceful degradation during API issues
  • Automatic retry mechanisms
  • Detailed error logging
  • User-friendly error messages

Updates & Maintenance

  • Regular performance optimizations
  • Security patch implementation
  • Feature enhancements
  • Database maintenance routines

Developer Information

Code Architecture

  • Modular design with separation of concerns
  • Asynchronous programming patterns
  • Efficient resource management
  • Scalable database design

Customization Options

  • Adjustable performance parameters
  • Configurable payment amounts
  • Customizable group limits
  • Template variable expansion

License & Usage Rights

License

This bot is developed for commercial use with the following considerations:

  • Payment system integration
  • Group management capabilities
  • Automated content updates
  • Professional support structure

Contact & Support

For technical support, feature requests, or bug reports:

  • Utilize in-bot /help command
  • Monitor performance metrics
  • Review system logs
  • Contact development team through official channels

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages