java.lang.Object
org.telegram.telegrambots.extensions.bots.commandbot.commands.BotCommand
org.telegram.telegrambots.extensions.bots.commandbot.commands.DefaultBotCommand
All Implemented Interfaces:
IBotCommand

public abstract class DefaultBotCommand extends BotCommand
Bot command with message ID in execute method
Author:
Vadim Goroshevsky (@vadimgoroshevsky)
  • Field Summary

    Fields inherited from class org.telegram.telegrambots.extensions.bots.commandbot.commands.BotCommand

    COMMAND_INIT_CHARACTER, COMMAND_PARAMETER_SEPARATOR_REGEXP
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultBotCommand(String commandIdentifier, String description)
    Construct a command
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    execute(org.telegram.telegrambots.meta.bots.AbsSender absSender, org.telegram.telegrambots.meta.api.objects.User user, org.telegram.telegrambots.meta.api.objects.Chat chat, Integer messageId, String[] arguments)
    Execute the command
    final void
    execute(org.telegram.telegrambots.meta.bots.AbsSender absSender, org.telegram.telegrambots.meta.api.objects.User user, org.telegram.telegrambots.meta.api.objects.Chat chat, String[] arguments)
    Execute the command
    void
    processMessage(org.telegram.telegrambots.meta.bots.AbsSender absSender, org.telegram.telegrambots.meta.api.objects.Message message, String[] arguments)
    Process the message and execute the command

    Methods inherited from class org.telegram.telegrambots.extensions.bots.commandbot.commands.BotCommand

    getCommandIdentifier, getDescription, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • DefaultBotCommand

      public DefaultBotCommand(String commandIdentifier, String description)
      Construct a command
      Parameters:
      commandIdentifier - the unique identifier of this command (e.g. the command string to enter into chat)
      description - the description of this command
  • Method Details

    • processMessage

      public void processMessage(org.telegram.telegrambots.meta.bots.AbsSender absSender, org.telegram.telegrambots.meta.api.objects.Message message, String[] arguments)
      Process the message and execute the command
      Specified by:
      processMessage in interface IBotCommand
      Overrides:
      processMessage in class BotCommand
      Parameters:
      absSender - absSender to send messages over
      message - the message to process
      arguments - passed arguments
    • execute

      public final void execute(org.telegram.telegrambots.meta.bots.AbsSender absSender, org.telegram.telegrambots.meta.api.objects.User user, org.telegram.telegrambots.meta.api.objects.Chat chat, String[] arguments)
      Description copied from class: BotCommand
      Execute the command
      Specified by:
      execute in class BotCommand
      Parameters:
      absSender - absSender to send messages over
      user - the user who sent the command
      chat - the chat, to be able to send replies
      arguments - passed arguments
    • execute

      public abstract void execute(org.telegram.telegrambots.meta.bots.AbsSender absSender, org.telegram.telegrambots.meta.api.objects.User user, org.telegram.telegrambots.meta.api.objects.Chat chat, Integer messageId, String[] arguments)
      Execute the command
      Parameters:
      absSender - absSender to send messages over
      user - the user who sent the command
      chat - the chat, to be able to send replies
      messageId - message id for interaction
      arguments - passed arguments