A Java client to call Telegram Bot APIs
- Download and compile the code
git clone https://github.com/xilu-wang/telegrambot-sdk-java.git
cd telegrambot-sdk-java
mvn clean install
- 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>
Add your telegram bot token in application.properties under resources
folder:
# example
token=1391770037:BBED1wvRkPVWCvxmczThmXYyUT4VXmCh-B4
- 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
}
- Run MessagingTest
- Run UpdatingTest