Skip to content

# Low-level work with bots

The base version of library was done a lot of time ago and just got several additions related to improvements, updates in Telegram Bot API or some requests from our community.

# Base things

There are several important things in context of this library:

- RequestsExecutor (also “known” as `TelegramBot`)
- Types
- Requests

So, in most cases all your request calls with simplified api of this library (like `bot.getMe()`) will looks like `bot.execute(GetMe)`. Result of these calls is defined in type of any request (for example, for GetMe request the result type is ExtendedBot). As a result, you can avoid any extension api (like special API extensions) and use low level request with full controlling of the whole logic flow.

## How to handle updates

As was written above, it will require some request:

    val updates = bot.execute(GetUpdates())

Result type of GetUpdates request is Update. You may find inheritors of this interface in Update kdocs.

## What is next?

As was said above, you may look into our API extensions in case you wish to use more high-level functions instead of `bot.execute(SomeRequest())`. Besides, it will be very useful to know more about updates retrieving.