# setContactByTelegramId()

{% hint style="info" %}
Эта функция предназначена для блока "**Входящий Webhook**" и будет работать только в нем.

Контакт должен являться подписчиком бота (т.е. существовать в боте на платформе)..
{% endhint %}

### Синтаксис:

```javascript
setContactByTelegramId(id)
```

`id` - Telegram id пользователя

### Возвращаемые значения:

`true / false` - логический (boolean)

### Пример:

В этом примере устанавливается контакт с Telegram id пользователя "12345".

```javascript
var checkId= setContactByTelegramId(12345);
if (checkId) {
    // Контакт успешно установлен и выполнится код из этого блока
}
```


---

# 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://jetbot.gitbook.io/api/javascript/vnutrennie-funkcii-js/setcontactbytelegramid.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.
