> For the complete documentation index, see [llms.txt](https://prethink.gitbook.io/prtelegrambot/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://prethink.gitbook.io/prtelegrambot/ru/oblast-vidimosti-bota-scope.md).

# Область видимости бота (Scope)

С версии 0.9 выполнение `update` происходит внутри специального `Scope`, который хранит все необходимые данные для работы.\
Теперь в любом коде, вызванном этим `update`, можно безопасно получить:

* Текущий контекст: `var currentContext = CurrentScope.Context`
* Текущий бот: `var currentBot = CurrentScope.Bot`
* Текущие сервисы: `var services = CurrentScope.Services` (IServiceProvider)

<figure><img src="/files/mA0ozZwEd4JIx54LEIC2" alt=""><figcaption></figcaption></figure>

Пример:

<figure><img src="/files/S41DUsfzLQjB2QN44UUk" alt=""><figcaption></figcaption></figure>
