> For the complete documentation index, see [llms.txt](https://docs.graspil.com/en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.graspil.com/en/connect-bot.md).

# Bot connection

You can connect a bot to Graspil in 4 different ways:

1. [Auto connection (MtProto)](#avto-podklyuchenie-mtproto)
2. [API](#api)
3. [MtProto collector on your own server](#sborshik-mtproto-na-vashem-servere)
4. [Proxying](#proksirovanie)

{% hint style="warning" %}
Make sure you connect your bot using only one of these methods, otherwise the data will be duplicated.
{% endhint %}

## Auto connection (MtProto)

This is the simplest way to connect. Just provide your token and the system will do everything for you.

This connection method uses the MtProto protocol, which works in parallel with your current connection. It works with all bots and bot builders. It collects slightly more data compared to the other methods.

### API

This method does not require passing a token. You can use the API to connect your bot to the platform. It takes a few minutes and requires writing just 1 request that will send the data.

You can read more about connecting a bot via API in [this section](/en/connect-bot/api.md)

## MtProto collector on your own server

You can install our data collector on your own server, getting the benefits of both methods - MtProto + API:

1. No need to pass a token
2. You get the maximum amount of data thanks to MtProto
3. No need to modify your bot - the system works independently of the bot.
4. You get access to broadcasts without passing a token, while keeping full control of the process.

{% hint style="warning" %}
This software is under development. If you're interested in this method and willing to take part in the beta test, let us know ;)
{% endhint %}

## Proxying

With this connection method, you need to insert our server between your bot and Telegram. More details are described in [this](/en/connect-bot/get-update.md#proksirovanie) section.

{% hint style="warning" %}
This connection method is outdated; we recommend using MtProto or API instead. These connection methods are more flexible and reliable.
{% endhint %}

<br>


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.graspil.com/en/connect-bot.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
