Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shibme/jtelebot
A Java library for Telegram Bot API
https://github.com/shibme/jtelebot
Last synced: 1 day ago
JSON representation
A Java library for Telegram Bot API
- Host: GitHub
- URL: https://github.com/shibme/jtelebot
- Owner: shibme
- License: gpl-3.0
- Created: 2015-09-03T04:35:18.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-03-29T06:45:46.000Z (over 6 years ago)
- Last Synced: 2023-07-28T10:23:36.180Z (over 1 year ago)
- Language: Java
- Homepage:
- Size: 1.11 MB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JTeleBot
[![Build Status](https://travis-ci.org/shibme/jtelebot.svg)](https://travis-ci.org/shibme/jtelebot)
[![Dependency Status](https://www.versioneye.com/user/projects/56adffaa7e03c7003ba414dd/badge.svg?style=flat)](https://www.versioneye.com/user/projects/56adffaa7e03c7003ba414dd)
[![Download](https://api.bintray.com/packages/shibme/maven/jtelebot/images/download.svg)](https://bintray.com/shibme/maven/jtelebot/_latestVersion)
[![Percentage of issues still open](http://isitmaintained.com/badge/open/shibme/jtelebot.svg)](http://isitmaintained.com/project/shibme/jtelebot "Percentage of issues still open")A Java library for [Telegram Bot API](https://core.telegram.org/bots/api)
### Maven Dependency for Consumers
Add to your `pom.xml`
```xmlme.shib.java.lib
jtelebot
2.1.2```
### Example
Start by creating an instance of the `me.shib.java.lib.jtelebot.TelegramBot` with the API token you get from [@BotFather](https://telegram.me/BotFather)
```java
TelegramBot bot = TelegramBot.getInstance("YourBotApiTokenGoesHere");
Update[] updates;
while((updates = bot.getUpdates()) != null) {
for (Update update : updates) {
Message message = update.getMessage();
if(message != null) {
bot.sendMessage(new ChatId(message.getChat().getId()), "This is a reply from the bot! :)");
}
}
}
```