Class TelegramUpdateConsumer

java.lang.Object
io.github.yvasyliev.forwarder.telegram.bot.service.TelegramUpdateConsumer
All Implemented Interfaces:
org.telegram.telegrambots.longpolling.interfaces.LongPollingUpdateConsumer

@Service public class TelegramUpdateConsumer extends Object implements org.telegram.telegrambots.longpolling.interfaces.LongPollingUpdateConsumer
Service for consuming updates from Telegram and handling them accordingly. It processes incoming updates, such as messages and callback queries, and delegates the handling to the appropriate event handlers.
  • Constructor Details

    • TelegramUpdateConsumer

      public TelegramUpdateConsumer(TelegramEventHandler<org.telegram.telegrambots.meta.api.objects.message.Message> messageHandler, TelegramEventHandler<org.telegram.telegrambots.meta.api.objects.CallbackQuery> callbackQueryHandler, tools.jackson.databind.json.JsonMapper jsonMapper)
  • Method Details

    • consume

      @Async public void consume(List<org.telegram.telegrambots.meta.api.objects.Update> updates)
      Specified by:
      consume in interface org.telegram.telegrambots.longpolling.interfaces.LongPollingUpdateConsumer