| import os |
| import logging |
|
|
| |
| |
| |
| BOT_TOKEN = os.getenv("BOT_TOKEN") |
| DB_URL = os.getenv("DATABASE_URL") |
| BASE_URL = "https://utoon.net" |
| ADMINS = {6065777038} |
|
|
| PAGE_SIZE = 20 |
| CHAPTER_PRICE = 100 |
|
|
| DAILY_MESSAGES = [ |
| "π *+50 Coins!* Come back tomorrow for more!", |
| "β‘ *Daily bonus collected!* +50 coins added.", |
| "π *You're on a streak!* +50 coins.", |
| ] |
|
|
| |
| |
| |
| logging.basicConfig( |
| level=logging.INFO, |
| format="%(asctime)s | %(levelname)s | %(name)s | %(message)s", |
| ) |
| logger = logging.getLogger(__name__) |
|
|
|
|
| def validate_required_env() -> None: |
| """Backward-compatible alias for web mode env validation.""" |
| validate_web_env() |
|
|
|
|
| def validate_web_env() -> None: |
| missing = [] |
| if not DB_URL: |
| missing.append("DATABASE_URL") |
| if missing: |
| raise RuntimeError( |
| f"Missing required environment variables: {', '.join(missing)}" |
| ) |
|
|
|
|
| def validate_bot_env() -> None: |
| missing = [] |
| if not BOT_TOKEN: |
| missing.append("BOT_TOKEN") |
| if not DB_URL: |
| missing.append("DATABASE_URL") |
| if missing: |
| raise RuntimeError( |
| f"Missing required environment variables: {', '.join(missing)}" |
| ) |
|
|