Bot Panel: code editor and bot files

Editor

The Editor tab: project files on the left, highlighted code on the right. Pick a file, make changes and click "Save" or press Ctrl+S.

Bot code editor
Bot code editor

Added a library to requirements.txt (Python), package.json (Node.js), composer.json (PHP) or Gemfile (Ruby)? Click "Install dependencies" under the file list.

Code changes take effect after a restart: click "Restart".

Files

The Files tab lists all bot files: "Upload" adds a file from your computer (images, databases, configs); each file has download and delete buttons.

The Files tab
The Files tab

If a library needs a system package (for example, for image processing or ffmpeg), install it in Settings - "System libraries" - "Manage packages".

How to update the bot's files

All options are on the Files tab. Config Vars and bot data do not change during an update.

  1. From a .zip — zip the changed files with the same folder structure (or the whole project), click "Update from .zip" and select the archive. Files from the archive replace bot files with the same paths, new files are added, and the rest stay as they are.
  2. From GitHub — click "From GitHub", paste the link to a public repository and the branch, and click Update.
  3. One file — the Replace icon in the file row: select a file from your computer. You can also edit code on the Editor tab. A new file is created with the "+" button in the Editor; the name may include a folder, for example handlers/start.py.
  4. If requirements.txt, package.json, composer.json or Gemfile changed, the panel offers Install dependencies.
  5. Click Restart — the bot starts with the new files.

Before every update from a .zip or GitHub, the panel saves a copy of the files being replaced (the last three are kept). The "Roll back" button restores the files as they were before the last update and removes added ones.

Questions and answers
Zip the bot folder and restore it via New bot - Restore, or upload the files in the Files tab. See the article on backups and import.
The main file is shown in the Overview tab (for example, bot.py or index.js).
On the Files tab, click "Update from .zip" or "From GitHub": only the files from the archive or repository are replaced. The panel saves a copy first, so you can undo the update with "Roll back".