###A Telegram architecture for build Telegram bots quickly with Spring MVC
To create your own bot:
-
Extends your own service from TelegramBotService to return your bot token (Example on org.telegram.telebot.service.myservices.MyTelegramService).
-
Create a Spring MVC controller like org.telegram.telebot.controller.MyWebhook
-
Your request mapping must be consume JSON via "consumes = MediaType.APPLICATION_JSON_VALUE"
-
Your request mapping must receive an Update with @RequestBody tag
-
On this moment your controller must have a @ResponseStatus(HttpStatus.NO_CONTENT) tag. In the future you can respond directly from this request to clients.
-
Inject your service in the controller.
-
Implents your Bot.
-
Open url /registerbot to register your webhook on telegram.
-
Enjoy your bot