Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xxlabaza/telegram-api
Telegram API implementation based on Feign
https://github.com/xxlabaza/telegram-api
Last synced: 14 days ago
JSON representation
Telegram API implementation based on Feign
- Host: GitHub
- URL: https://github.com/xxlabaza/telegram-api
- Owner: xxlabaza
- License: mit
- Created: 2016-01-02T00:53:09.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-02T21:41:19.000Z (almost 9 years ago)
- Last Synced: 2023-03-01T14:32:17.343Z (over 1 year ago)
- Language: Java
- Size: 415 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Telegram API
Telegram API implementation based on Feign http client.## Include dependency
Add the following snippet to any project's pom that depends on **telegram-api** project:
```xml
telegram-api
https://raw.github.com/xxlabaza/telegram-api/mvn-repo/
true
always
```
Then, include dependency to your project:
```xml...
ru.xxlabaza
telegram-api
1.0.0
...```
## Authorizing your bot
Each bot is given a unique authentication token [when it is created](https://core.telegram.org/bots#botfather). The token looks something like 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11.## Basic usage
* Getting info about bot:
```java
TelegramService SERVICE = new TelegramService("");
User user = SERVICE.getMe().call();Assert.assertNotNull(user.getId());
Assert.assertNotNull(user.getFirstName());
```* Sending message:
```java
Message message = SERVICE.sendMessage()
.chat("")
.text("Hello world!")
.call();
```* Read user's input:
```java
List updates = SERVICE.getUpdates()
.offset(10)
.limit(50)
.call();
```For more information - read [Telegram API](https://core.telegram.org/api) and library's **JavaDoc**.