Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 1.22 KB

File metadata and controls

42 lines (30 loc) · 1.22 KB

Telegram Spring Boot Starter

Build Status Jitpack

This is a starter pom for a spring boot application with the TelegramBots Java API.

First, you need to add jitpack as a repository to your pom of your spring boot app

<repositories>
	<repository>
	    <id>jitpack.io</id>
	    <url>https://jitpack.io</url>
	</repository>
</repositories>

Then you have to add the following dependency to the pom

<dependency>
	<groupId>com.github.xabgesagtx</groupId>
	<artifactId>telegram-spring-boot-starter</artifactId>
	<version>0.12</version>
</dependency>

The only thing you need to do now is to create a bean for a bot. E.g.:

@Component
public class Bot extends TelegramLongPollingBot {
...
} 

The bot will then be registered for you automatically on startup.

Example

An implementation example is available too.