---
title: "Edit Telegram Bot Code - Panel, SFTP & VS Code | FPS.ms"
description: "Edit your hosted Telegram bot code via the FPS.ms panel, SFTP, or VS Code remote sync. Set up upload-on-save for fast development."
url: https://fps.ms/docs/telegram-bots/editing-code
---
# Editing code

After [installing your Telegram bot](https://fps.ms/docs/telegram-bots/installation.md) on FPS.ms, you can edit your code in three ways: directly through the panel file manager, via an SFTP client, or with VS Code live sync.

## Panel file manager

The simplest option — edit files directly in the **Files** tab of the [FPS.ms panel](https://panel.fps.ms). This works well for quick changes like updating a command response or fixing a typo.

## SFTP client

Use any [SFTP client](https://fps.ms/docs/getting-started/connecting-to-sftp.md) (like FileZilla) to open and edit your bot files in your preferred editor. This gives you full control over your project files and is better for working with multiple files.

## VS Code live sync

For the best development experience, use VS Code with SFTP sync. Changes you save locally are automatically uploaded to your FPS.ms server.

1. Download the [SFTP Extension](https://marketplace.visualstudio.com/items?itemName=Natizyskunk.sftp) for VS Code.
2. Open a local directory you want to sync to your server (or create an empty one to download your server files into).
3. Open the command palette (`Ctrl+Shift+P` on Windows/Linux, `Cmd+Shift+P` on Mac) and run `SFTP: config`.
4. A `sftp.json` file appears under the `.vscode` directory.
5. Fill in the values from your FPS.ms server — find them in the **Settings** tab under **SFTP Details**. You will also need to [set a password](https://fps.ms/docs/getting-started/setting-a-password.md) if you haven't already. Here is an example config:

```json title=".vscode/sftp.json"
{
    "name": "My Telegram Bot",
    "host": "mango/papaya/pineapple/guava/other.fps.ms",
    "protocol": "sftp",
    "port": 2022,
    "username": "SFTP_USERNAME",
    "remotePath": "/",
    "uploadOnSave": true,
    "useTempFile": false,
    "openSsh": false,
    "ignore": [".vscode", ".git", ".DS_Store", ".cache", ".local", ".env"]
}
```

!!! warning "Keep .env out of sync" "Add `.env` to the ignore list in your `sftp.json` to avoid accidentally syncing your bot token. Create the `.env` file directly on the FPS.ms panel instead."

**Optionally**: Add the `password` key to the JSON with your FPS.ms password. **Note that this stores your password in plaintext — make sure `.vscode` is in your ignore list so it doesn't get synced to the server where subusers could see it.**

**Optionally**: If you already have files on your server, open the command palette and run `SFTP: Sync Both Directions` to sync your local folder with the FPS.ms server.

**Optionally**: Disable `uploadOnSave` in the `sftp.json` file if you don't want files automatically synced when you save.

For more details, refer to the [SFTP extension documentation](https://marketplace.visualstudio.com/items?itemName=Natizyskunk.sftp).

## Restarting after changes

After editing your bot code, you need to restart the server for changes to take effect:

1. Go to the **Console** tab on the FPS.ms panel
2. Click **Restart**
3. Check the console output for any errors

!!! tip "Faster development" "With VS Code SFTP and `uploadOnSave` enabled, your workflow is: edit locally → save → restart server on the panel. You can also set up a [schedule](https://fps.ms/docs/getting-started/creating-schedules.md) to auto-restart at intervals during development."

## Next steps

- [Set up environment variables](https://fps.ms/docs/telegram-bots/using-environment-variables.md) — manage your bot token securely
- [Add commands](https://fps.ms/docs/telegram-bots/adding-commands.md) — make your bot interactive
- [Upload files via SFTP](https://fps.ms/docs/getting-started/connecting-to-sftp.md) — transfer files with FileZilla
- [Troubleshoot common issues](https://fps.ms/docs/telegram-bots/troubleshooting.md) — fix errors and crashes

---

[FPS.ms](https://fps.ms/index.html.md) · [All pages](https://fps.ms/llms.txt) · [Documentation](https://fps.ms/docs/llms.txt)
