Class DefaultBotCommand

  • All Implemented Interfaces:
    IBotCommand

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

      • 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 Detail

      • 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