Open LexProfi opened 2 years ago
https://github.com/rubenlagus/TelegramBots/tree/master/telegrambots-spring-boot-starter
This is not entirely suitable, because in telegrambots-spring-boot-starter
it is proposed to create a class heir to TelegramLongPollingBot
import org.telegram.telegrambots.bots.TelegramLongPollingBot;
While the ability library implements LongPollingBot
import org.telegram.telegrambots.meta.generics.LongPollingBot;
The question is how to run telegrambots-abilities in Spring.
It work for class extending AbilityBot
Hello! This might be super late, but I just started playing with this library.
Here's what I did to be able to use abilities with Spring:
@AfterBotRegistration public void afterRegistration(BotSession botSession) { this.onRegister(); }
@Override public LongPollingUpdateConsumer getUpdatesConsumer() { return this; }
With the first method, you're forcing the AbilityBot to get initialized, forcing the scan of the abilities you implement at the class level.
Hope this is useful for someone else.
Cheers!
Tell me - how can I run the ability library using spring boot?