Interface ICommandHandler

    • Method Detail

      • getCommand

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

        java.lang.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

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

        default java.lang.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,
                              java.util.List<java.lang.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