Class MessageHandler

java.lang.Object
io.github.yvasyliev.telegramforwarderbot.service.MessageHandler
All Implemented Interfaces:
TelegramEventHandler<org.telegram.telegrambots.meta.api.objects.message.Message>

@Service public class MessageHandler extends Object implements TelegramEventHandler<org.telegram.telegrambots.meta.api.objects.message.Message>
Handles incoming Telegram messages and executes the corresponding command. It checks if the message is a command and retrieves the command name from the message entities. If the command is found, it executes the corresponding MessageCommand.
  • Constructor Details

    • MessageHandler

      public MessageHandler()
  • Method Details

    • handle

      public void handle(org.telegram.telegrambots.meta.api.objects.message.Message message)
      Description copied from interface: TelegramEventHandler
      Handles a Telegram event of type T.
      Specified by:
      handle in interface TelegramEventHandler<org.telegram.telegrambots.meta.api.objects.message.Message>
      Parameters:
      message - the event to handle