Botxona

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
FieldTypeDescription
runtimepython \node \go \phpUseful when the language can't be detected automatically (e.g. files for both languages are present)
entrystringPath to the file to run, e.g. src/main.py (for Go — the package path, e.g. ./cmd/bot)
startstringFull start command — when you need arguments or a custom script
updatesauto \polling \webhookHow updates are delivered. auto (default) — webhook if the bot calls setWebhook, otherwise polling. A mode chosen in the dashboard (Settings → Updates) takes priority
webhook.port1–65535The port your HTTP server listens on (8080 by default); also exported as PORT
webhook.pathstarts with /The path used when the bot doesn't call setWebhook itself (/webhook by default); also exported as WEBHOOK_PATH
always_ontrue/falseKeep the bot always on or, conversely, let it sleep even if it has a scheduler
python3.10 \3.11 \3.12 \3.13Python 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
writablelist of directory/file namesTop-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

  1. If start is set — that exact command is used and entry is ignored.
  2. Otherwise, if entry is set — that file is run with the standard command for the runtime (python -u <entry>, node <entry>, or for Go the <entry> package is built into a binary).
  3. If neither is set — the system detects the entry point automatically via main.py/bot.py/app.py (Python) or the "start" script / main field in package.json (Node.js), or for Go the main package in the root (main.go) / a single cmd/<name>/ folder. A Go project is detected by a go.mod in the root (or runtime: 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" (or runtime.txt). Supported: 3.10, 3.11, 3.12, 3.13. If a library won't install (for example pandas==1.5.3 can't build on 3.12), pick an older version. When an old exact pin such as pandas or scipy is used and numpy isn't listed, the install automatically gets a numpy<2 constraint.
  • Writing to relative paths. The filesystem is read-only, so writes like data/bot.sqlite3 or open("users.json", "w") normally fail. The platform finds such directories/files and links them into /data (no code change needed). If detection misses one, add writable: [folder, file.json]. Using DATA_DIR is 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 (or index.php / composer.json). A script that reads php://input is treated as a webhook bot: it runs under PHP's built-in server (php -S) and updates are delivered to it automatically, with no setWebhook call. Any other script runs as php file.php. If a Node.js/Python wrapper starts php itself, PHP is installed in the image.

Next step

Full details on entry points and libraries: 6 rules. On environment variables: Environment variables.