All Known Implementing Classes:
CommandLongPollingTelegramBot, TelegramWebhookCommandBot

public interface CommandBot
This interface represents common functions for command bots
Author:
Andrey Korsakov (loolzaaa)
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    filter(Message message)
    Override this function in your bot implementation to filter messages with commands
    default void
    This method is called when user sends a not registered command.
    void
    processNonCommandUpdate(Update update)
    Process all updates, that are not commands.
  • Method Details

    • processNonCommandUpdate

      void processNonCommandUpdate(Update update)
      Process all updates, that are not commands.
      Parameters:
      update - the update
    • processInvalidCommandUpdate

      default void processInvalidCommandUpdate(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(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