# Publishing a script

## Publishing a script

The publishing interface shows the current state of the script. Possible states:&#x20;

* Script not published
* The script has been published and has been modified since the last publication&#x20;

"The script is not published" means that it does not work in any channel and is still a draft. If the script is not published, the publish button will be available to you. More information about connecting channels is written in the article "How to connect the messenger".&#x20;

If the script was published earlier, then it is already working for your subscribers. However, you can change it in draft mode. For example, you want to change the logic of the bot, but do not want to publish it right away, but first you want to test it. In such a case, you can modify the script and test it, but not publish it. In this case, the publishing interface will look like this:

Интерфейс публикации показывает текущее состояние сценария. Возможные состояния:

* Сценарий не опубликован
* Сценарий опубликован и был изменен с момента последней публикации

"Сценарий не опубликован" означает, что он не работает ни в одном канале и пока является **черновиком**. Если сценарий не опубликован, вам будет доступна кнопка публикации. Подробнее про подключение каналов написано в статье ["Как подключить мессенджер"](/beginning-of-work/how-to-add-messenger.md).

Если сценарий был опубликован ранее, то для ваших подписчиков он уже работает. При этом вы можете его изменять в режиме черновика. Например, вы захотели изменить логику бота, но не хотите сразу публиковать ее, а сначала хотите проверить. В таком случае вы можете изменить сценарий и тестировать его, но не публиковать.

В этом случае интерфейс публикации будет выглядеть так:

&#x20;

![](/files/jk9aN6e4skOuPL8oNQBj)

By clicking on the "show published version" button, you will switch to the "clean" version of the script, that is, the last published version. Your followers see it.&#x20;

By clicking on the "reset changes" button, all your changes relative to the last published (clean) version will be deleted. The script will return to its last published state. The "changes not published".

icon is shown if you have changed the script graph after publishing. That is, what you see now is a draft version.&#x20;

To publish a draft, click the publish button. Then your draft (what you see in the script editor at this moment) will become a "clean draft" and will work for all subscribers.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.smartbotpro.io/scripts/basics/publishing-a-script.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
