TelegramBots/telegrambots-spring-boot-starter
Andrea Cavalli 6ea5b8c540 Merge commit 'b03fe98798192840402168e6e422d1b4cee48279'
Conflicts:
	pom.xml
	telegrambots-spring-boot-starter/pom.xml
	telegrambots/pom.xml
	telegrambots/src/main/java/org/telegram/telegrambots/updatesreceivers/DefaultWebhook.java
2020-11-11 15:40:29 +01:00
..
src Update changelog and how to update 2020-11-03 21:09:02 +00:00
pom.xml Merge commit 'b03fe98798192840402168e6e422d1b4cee48279' 2020-11-11 15:40:29 +01:00
README.md Updage 5.0.1 2020-11-08 16:19:38 +00:00

abilitybots

Build Status Jitpack JavaDoc Telegram ghit.me

Usage

Maven

    <dependency>
        <groupId>org.telegram</groupId>
        <artifactId>telegrambots-spring-boot-starter</artifactId>
        <version>5.0.1</version>
    </dependency>

Gradle

    compile "org.telegram:telegrambots-spring-boot-starter:5.0.1"

Motivation

If you are spring boot user it`s better to be in touch with spring starters. This module allows to register bots in spring context automatically and also use them as standard spring beans.

How to use

Your main spring boot class should look like this:

@SpringBootApplication
public class YourApplicationMainClass {

	public static void main(String[] args) {		
		SpringApplication.run(YourApplicationMainClass.class, args);
	}
}

After that your bot will look like:

  //Standard Spring component annotation
  @Component
  public class YourBotName extends TelegramLongPollingBot {
    //Bot body.
  }

Also you could just implement LongPollingBot or WebHookBot interfaces. All this bots will be registered in context and connected to Telegram api.