TT-Bot uses environment variables for all configuration. Create aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/karilaa-dev/tt-bot/llms.txt
Use this file to discover all available pages before exploring further.
.env file in the project root based on .env.example.
Bot Configuration
Core bot settings for Telegram integration.Telegram bot token from @BotFatherExample:
12345:abcdeToken for the statistics botExample:
12345:abcdeTelegram API server URL. Use custom Bot API server if self-hosting.Example:
http://telegram-bot-api:8081Telegram API ID from my.telegram.orgExample:
1234567Telegram API hash from my.telegram.orgExample:
abc123JSON array of Telegram user IDs with admin privilegesExample:
[1234567, 7654321]JSON array of additional user IDs with secondary admin privilegesExample:
[1234567]Channel ID for uploading videos to get
file_id. Enables file caching.Example: 12345API Configuration
External API settings for third-party integrations.RapidAPI key for Instagram downloads. Get from RapidAPIExample:
abcde12345fgh67890ijklmnopqrstuAPI key for bot statistics serviceExample:
abcdefg12345Monetag monetization link URLExample:
https://example.com/your-monetag-link/Database Configuration
PostgreSQL connection settings.PostgreSQL connection URL. Automatically converted to use
asyncpg driver.Format: postgresql://user:password@host:port/databaseExample: postgresql://postgres:postgres@db/ttbot-dbProxy Configuration
Proxy rotation settings for bypassing rate limits and regional restrictions.Path to file containing proxy URLs (one per line). See Proxy Setup for format.Example:
proxies.txtWhen
true, use proxies only for API requests, not media downloads. Improves download speed.Example: falseWhen
true, include direct host connection (no proxy) in round-robin rotation.Example: falseRetry Configuration
Three-part retry strategy with proxy rotation. Each part has independent retry limits.Maximum retries for Part 1: URL resolution (short URLs to full URLs)Example:
3Maximum retries for Part 2: Video info extraction (metadata and video data)Example:
3Maximum retries for Part 3: Download (video/images/music download)Example:
3Performance Configuration
Resource management and optimization settings.Maximum concurrent videos per user in queue.
0 = no limit.Example: 0Use streaming for videos longer than this (seconds).
0 = never stream.Example: 300Maximum video duration in seconds.
0 = no limit.Example: 0Logging Configuration
Application logging settings.Logging verbosity level.Options:
DEBUG, INFO, WARNING, ERROR, CRITICALExample: INFOStatistics Configuration
Settings for the statistics bot.JSON array of user IDs who can access statisticsExample:
[-1234567]Chat ID where statistics are postedExample:
-1234567Message ID for hourly statistics updatesExample:
23Message ID for daily statistics updatesExample:
24Chat ID for join/leave logsExample:
-1234567Optional Configuration
Additional optional settings.Path to Netscape cookies file for yt-dlp. Used for authenticated requests.Example:
cookies.txtEnvironment File Example
.env

