> For the complete documentation index, see [llms.txt](https://docs.watbot.ru/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.watbot.ru/js-api/peremennye.md).

# Переменные

Для удобства все константы пользователя (контакта) можно использовать в вашем коде как обычные JavaScript переменные.

### Список переменных

* `id` - ID контакта
* `bot_id` - ID бота
* `name` - Полное имя контакта
* `first_name` - Имя контакта
* `last_name` - Фамилия контакта
* `phone` - Телефон контакта
* `email` - Электронная почта контакта
* `address` - Адрес контакта
* `created_at` - Дата создания контакта в формате [`Y-m-d H:i:s`](https://www.php.net/manual/en/datetime.format.php#refsect1-datetime.format-parameters)
* `username` - Username контакта
* `telegram_id` - ID контакта в Телеграм&#x20;
* `max_id` - ID контакта в Max
* `start_message` - Стартовое сообщение пользователя перед началом использования чат-бота

### Пример

Допустим текущего пользователя зовут Дмитрий, тогда в переменную `test` запишется строка `Привет Дмитрий!`

```javascript
var test = "Привет " + first_name + "!";
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.watbot.ru/js-api/peremennye.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.
