Interface CommandBot

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default boolean filter​(org.telegram.telegrambots.meta.api.objects.Message message)
      Override this function in your bot implementation to filter messages with commands
      default void processInvalidCommandUpdate​(org.telegram.telegrambots.meta.api.objects.Update update)
      This method is called when user sends a not registered command.
      void processNonCommandUpdate​(org.telegram.telegrambots.meta.api.objects.Update update)
      Process all updates, that are not commands.
    • Method Detail

      • processNonCommandUpdate

        void processNonCommandUpdate​(org.telegram.telegrambots.meta.api.objects.Update update)
        Process all updates, that are not commands.
        Parameters:
        update - the update
      • processInvalidCommandUpdate

        default void processInvalidCommandUpdate​(org.telegram.telegrambots.meta.api.objects.Update update)
        This method is called when user sends a not registered command. By default it will just call processNonCommandUpdate(), override it in your implementation if you want your bot to do other things, such as sending an error message
        Parameters:
        update - Received update from Telegram
      • filter

        default boolean filter​(org.telegram.telegrambots.meta.api.objects.Message message)
        Override this function in your bot implementation to filter messages with commands

        For example, if you want to prevent commands execution incoming from group chat: # # return !message.getChat().isGroupChat(); #

        Parameters:
        message - Received message
        Returns:
        true if the message must be ignored by the command bot and treated as a non command message, false otherwise