Cross references:
../../README.md../../docs/telegram-bot.mdScope note:
/start, /welcome, /help, /about, /version, /user, /config, /explain, /debug/invent <story>, /random/peek, /peek <n>, /peek<n>/vendors, /vendor <role> <name>, /vendor <name>, /models [role] [model], /test/panels, /objective, /objectives, objective shortcuts, /style, style shortcuts, /new_style, /language, /mode, /consistency, /detail, /crazyness, /concurrency, /retries/prompts, /set_prompt, /list_options, /options/keys, /setkey, /unsetkey, /reset_config, /restarttelegram/src/webhook-bot.jstelegram/src/generate.jsengine/src/*telegram/src/data/* (messages, providers, styles/objectives, options, thresholds)engine/src/data/prompt-templates.jstelegram/src/config-store.jstelegram/src/persistence.js + request/crash log storesProcessing model:
Input from message.text, media attachments, or message.caption is classified as:
Source-specific flows extract structured text before generation:
Background + Image description; Story title line removed; references summary style when available)Important behavior:
X(Y) prefixgeneration.panel_watermark, default true)generation.consistency, default true)protect_content=false to keep forwarding enabledPrimary command handling is in handleCommand.
Notable UX behavior:
/objective without args lists all objectives/crazyness <0..2> controls story invention temperature/options without args explains valid paths/options; apply via dedicated commands (/objective, /panels, /mode, /vendor, /models, etc.)/keys shows runtime key status/vendors [role] prints available provider roles and optionsDetected link, parsing page: <url> with the exact parsed URLBlacklist is persistent in config state:
Ban checks run before allowlist checks during message processing.
BOT_SECRETS_ENV_ONLY=true disables YAML fallback for deployment/CIPrimary suites:
npm run test:telegram:localnpm run test:telegramnpm run test:telegram:r2-realnpm run test:telegram:full-stacknpx vitest run -c telegram/vitest.config.js telegram/tests/webhook-url-real.e2e.test.js (opt-in with RUN_WEBHOOK_URL_REAL=true)Secret checks before deploy/tests:
npm run secrets:validate:deploy:cinpm run secrets:validate:tests:ciUse:
npm run bot:deploy:auto -- --target render --env staging --branch stage1 --env-only
See:
telegram/docs/deployment-runbook.mdtelegram/docs/testing.md