botxona.yaml — full schema
Updated:
botxona.yaml is an optional file at the root of the archive (botxona.yml is accepted too). It lets you state explicitly what the system can't detect on its own. The bot works without it — the system will try to detect things automatically.
Fields
runtime: python # python | node | go | php — set explicitly if the language isn't detected automatically
entry: main.py # file to run (used together with runtime)
start: python -u main.py --prod # full command — instead of entry, with extra arguments
always_on: true # true — bot is always on, false — sleeps when idle
updates: webhook # auto (default) | polling | webhook — how updates reach the bot
webhook:
port: 8080 # the port your HTTP server listens on (also exported as )
path: /webhook # used when the bot doesn't call setWebhook itself
| Field | Type | Description | |||
|---|---|---|---|---|---|
runtime | python \ | node \ | go \ | php | Useful when the language can't be detected automatically (e.g. files for both languages are present) |
entry | string | Path to the file to run, e.g. src/main.py (for Go — the package path, e.g. ./cmd/bot) | |||
start | string | Full start command — when you need arguments or a custom script | |||
updates | auto \ | polling \ | webhook | How updates are delivered. auto (default) — webhook if the bot calls setWebhook, otherwise polling. A mode chosen in the dashboard (Settings → Updates) takes priority | |
webhook.port | 1–65535 | The port your HTTP server listens on (8080 by default); also exported as PORT | |||
webhook.path | starts with / | The path used when the bot doesn't call setWebhook itself (/webhook by default); also exported as WEBHOOK_PATH | |||
always_on | true/false | Keep the bot always on or, conversely, let it sleep even if it has a scheduler | |||
python | 3.10 \ | 3.11 \ | 3.12 \ | 3.13 | Python version (default 3.12). runtime.txt (python-3.11.4) and .python-version are read too. For old pinned libraries (e.g. pandas==1.5.3) the platform picks 3.11 itself |
writable | list of directory/file names | Top-level directories or files your code writes to with a relative path (data, users.json). They are linked into /data, so the data is kept and backed up. Usually detected automatically; set it only when detection misses one |
Precedence
- If
startis set — that exact command is used andentryis ignored. - Otherwise, if
entryis set — that file is run with the standard command for theruntime(python -u <entry>,node <entry>, or for Go the<entry>package is built into a binary). - If neither is set — the system detects the entry point automatically via
main.py/bot.py/app.py(Python) or the"start"script /mainfield inpackage.json(Node.js), or for Go themainpackage in the root (main.go) / a singlecmd/<name>/folder. A Go project is detected by ago.modin the root (orruntime: go/golang).
If always_on is set, it determines the initial value of the "Auto" mode under Settings → Run mode on the bot page — the user can later change it manually in the dashboard (Sleep and wake-up).
Examples
A simple Python bot with a non-standard file name:
runtime: python
entry: src/bot.py
Go with a cmd/bot package:
runtime: go
entry: ./cmd/bot
Node.js with a custom start command:
start: node --experimental-modules src/index.mjs
A bot that must always be on (e.g. it sends payment reminders):
always_on: true
A bot that uses a webhook (listens on , serves the path /tg):
updates: webhook
webhook:
port: 8080
path: /tg
An invalid updates value, a port outside 1–65535 or a path that doesn't start with / fails the check. More: Webhook or long polling.
Python version, writable paths and PHP
- Python version.
python: "3.11"(orruntime.txt). Supported: 3.10, 3.11, 3.12, 3.13. If a library won't install (for examplepandas==1.5.3can't build on 3.12), pick an older version. When an old exact pin such aspandasorscipyis used andnumpyisn't listed, the install automatically gets anumpy<2constraint. - Writing to relative paths. The filesystem is read-only, so writes like
data/bot.sqlite3oropen("users.json", "w")normally fail. The platform finds such directories/files and links them into/data(no code change needed). If detection misses one, addwritable: [folder, file.json]. UsingDATA_DIRis still the better practice. Note: if the archive already contains the directory, its files are copied on first start and later deploys only add NEW files; changed files are never overwritten (so the bot's data is kept). - PHP.
runtime: php(orindex.php/composer.json). A script that readsphp://inputis treated as a webhook bot: it runs under PHP's built-in server (php -S) and updates are delivered to it automatically, with nosetWebhookcall. Any other script runs asphp file.php. If a Node.js/Python wrapper startsphpitself, PHP is installed in the image.
Next step
Full details on entry points and libraries: 6 rules. On environment variables: Environment variables.