Including in your project

There are three projects:

  • TelegramBotAPI Core - project with base for all working with Telegram Bot API
  • TelegramBotAPI API Extensions - extension of TelegramBotAPI with functions for more comfortable work with Telegram Bot API
  • TelegramBotAPI Utils Extensions - extension of TelegramBotAPI with functions for extending of different things like retrieving of updates

TelegramBotAPI
Also, there is an aggregator-version TelegramBotAPI, which will automatically include all projects above. It is most recommended version due to the fact that it is including all necessary tools around TelegramBotAPI Core, but it is optionally due to the possible restrictions on the result methods count (for android) or bundle size

Examples
You can find full examples info in this repository. In this repository there full codes which are working in normal situation. Currently, there is only one exception when these examples could work incorrectly: you are living in the location where Telegram Bot API is unavailable. For solving this problem you can read Proxy setup part

Notice about repository

To use this library, you will need to include Maven Central repository in your project

build.gradle
mavenCentral()
pom.xml
<repository>
  <id>central</id>
  <name>mavenCentral</name>
  <url>https://repo1.maven.org/maven2</url>
</repository>

TelegramBotAPI

As tgbotapi_version variable in next snippets will be used variable with next last published version:

Download

build.gradle
implementation "dev.inmo:tgbotapi:$tgbotapi_version"
pom.xml
<dependency>
    <groupId>dev.inmo</groupId>
    <artifactId>tgbotapi</artifactId>
    <version>${tgbotapi_version}</version>
</dependency>

TelegramBotAPI Core

As tgbotapi_version variable in next snippets will be used variable with next last published version:

Download

build.gradle
implementation "dev.inmo:tgbotapi.core:$tgbotapi_version"
pom.xml
<dependency>
    <groupId>dev.inmo</groupId>
    <artifactId>tgbotapi.core</artifactId>
    <version>${tgbotapi_version}</version>
</dependency>

TelegramBotAPI API Extensions

As tgbotapi_version variable in next snippets will be used variable with next last published version:

Download

build.gradle
implementation "dev.inmo:tgbotapi.extensions.api:$tgbotapi_version"
pom.xml
<dependency>
    <groupId>dev.inmo</groupId>
    <artifactId>tgbotapi.extensions.api</artifactId>
    <version>${tgbotapi_version}</version>
</dependency>

TelegramBotAPI Utils Extensions

As tgbotapi_version variable in next snippets will be used variable with next last published version:

Download

build.gradle
implementation "dev.inmo:tgbotapi.extensions.utils:$tgbotapi_version"
pom.xml
<dependency>
    <groupId>dev.inmo</groupId>
    <artifactId>tgbotapi.extensions.utils</artifactId>
    <version>${tgbotapi_version}</version>
</dependency>

Next steps