/telegrambot-sdk-java

A Java client to call Telegram Bot APIs

Primary LanguageJava

telegrambot-sdk-java

A Java client to call Telegram Bot APIs

Install

  1. Download and compile the code
git clone https://github.com/xilu-wang/telegrambot-sdk-java.git
cd telegrambot-sdk-java
mvn clean install
  1. Add the library in your maven project pom.xml
<dependencies>
    <dependency>
        <groupId>com.xiluwang</groupId>
        <artifactId>telegrambot-sdk-java</artifactId>
        <version>1.0.0-SNAPSHOT</version>
    </dependency>
</dependencies>

Usage

Step 1.

Add your telegram bot token in application.properties under resources folder:

# example
token=1391770037:BBED1wvRkPVWCvxmczThmXYyUT4VXmCh-B4
Step 2.
  • Run ApiTest, and you should get your bot info such as follows:
{
  "id" : 100000000,
  "is_bot" : true,
  "first_name" : "test cat",
  "username" : "test_bot",
  "can_join_groups" : true,
  "can_read_all_group_messages" : true,
  "supports_inline_queries" : false
}

Interfaces