Interface ICommandHandler

All Superinterfaces:
ITelegramHandler

public interface ICommandHandler extends ITelegramHandler
  • Method Details

    • getCommand

      String getCommand()
      Returns:
      The command that will trigger @{link onCommandMessage} method
    • getUsage

      String getUsage()
      Returns:
      The usage of the command whenever user types in /command without parameters some commands may return that if requires arguments to be supplied
    • getDescription

      String getDescription()
      Returns:
      The description of the command shown in /help
    • getCategory

      default String getCategory()
      Returns:
      The category mapping whenever u type in /help that would group current command to the returned category
    • onCommandMessage

      void onCommandMessage(AbstractTelegramBot bot, org.telegram.telegrambots.meta.api.objects.Update update, org.telegram.telegrambots.meta.api.objects.message.Message message, List<String> args) throws org.telegram.telegrambots.meta.exceptions.TelegramApiException
      Fired when user types in /command arg0 arg1 arg2..
      Parameters:
      bot - the bot
      update - the update
      message - the message
      args - the arguments after command separated by space or wrapped within "things here are considered one arg"
      Throws:
      org.telegram.telegrambots.meta.exceptions.TelegramApiException - the exception