# Copy this file to server/telegram.local.env and fill in your real values.

HOST=0.0.0.0
PORT=8787

# Required for real Telegram messaging.
TELEGRAM_BOT_TOKEN=123456789:replace-with-your-bot-token

# Required for web Telegram Login Widget. Use the bot username from BotFather, without @.
TELEGRAM_BOT_USERNAME=your_bot_username

# Optional for official Telegram OAuth web auth.
# Must match the HTTPS domain configured for your bot in BotFather /setdomain.
# Leave blank for local-PC mode; the app will use the bot /start handoff instead.
TELEGRAM_BOT_ID=
TELEGRAM_AUTH_ORIGIN=

# Strongly recommended so Telegram webhook calls can be verified.
TELEGRAM_WEBHOOK_SECRET=replace-with-a-long-random-string

# Required for the webhook register/delete/info admin routes.
TELEGRAM_ADMIN_KEY=replace-with-your-own-admin-key

# Public HTTPS URL that points to this server.
# Example: https://bagel-bot.yourdomain.com
TELEGRAM_PUBLIC_WEBHOOK_URL=

# Public URL for the BagelScanner app that Telegram users should open.
# If you keep this as localhost, only the PC hosting the app can open it.
TELEGRAM_WEBAPP_URL=http://127.0.0.1:5175
TELEGRAM_WEBAPP_ENABLED=false

# Optional local image path sent with /start and /help.
# Leave blank to use server/assets/bagelscanner-welcome.png.
TELEGRAM_WELCOME_IMAGE_PATH=

# Optional comma-separated allowlist. Leave blank to allow any chat that reaches the bot.
# Example: 123456789,987654321
TELEGRAM_ALLOWED_CHAT_IDS=

# Subscription plan resolver for Telegram users.
# Keys can be Telegram numeric IDs or usernames. Valid plans: Free, Starter, Skenner, Owner
# Example: 123456789:Owner,@myusername:Skenner,987654321:Starter
TELEGRAM_USERS_FILE=server/data/users.json
TELEGRAM_DEFAULT_USER_PLAN=Free
TELEGRAM_USER_PLANS=

# Local-PC mode: enables Telegram long polling so you do not need a public webhook URL.
# Recommended when you are hosting the bot directly on your PC.
TELEGRAM_POLLING=false

# If polling is enabled, set this true once to clear any existing Telegram webhook first.
TELEGRAM_POLLING_DELETE_WEBHOOK=false

# Safety guardrails for scans started inside Telegram.
TELEGRAM_MAX_SCAN_TARGETS=25
TELEGRAM_MAX_STORED_JOBS=50
TELEGRAM_MAX_ACTIVE_JOBS=3
TELEGRAM_MAX_ACTIVE_JOBS_PER_CHAT=1
TELEGRAM_SCAN_COOLDOWN_SECONDS=20
TELEGRAM_MAX_TXT_BYTES=262144

# Which BagelScanner tier limits the Telegram scanner should obey.
# Valid examples: Free, Starter, Skenner, Owner
TELEGRAM_BOT_PLAN=Skenner
