Object
BotCommand
DefaultBotCommand
All Implemented Interfaces:
IBotCommand

public abstract class DefaultBotCommand extends BotCommand
Bot command with message ID in execute method
Author:
Vadim Goroshevsky (@vadimgoroshevsky)
  • 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(TelegramClient telegramClient, Message message, String[] arguments)
      Process the message and execute the command
      Specified by:
      processMessage in interface IBotCommand
      Overrides:
      processMessage in class BotCommand
      Parameters:
      telegramClient - Client to send messages over
      message - the message to process
      arguments - passed arguments
    • execute

      public final void execute(TelegramClient telegramClient, User user, Chat chat, String[] arguments)
      Description copied from class: BotCommand
      Execute the command
      Specified by:
      execute in class BotCommand
      Parameters:
      telegramClient - Client 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(TelegramClient telegramClient, User user, Chat chat, Integer messageId, String[] arguments)
      Execute the command
      Parameters:
      telegramClient - Client 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