Class DefaultBotCommand
java.lang.Object
org.telegram.telegrambots.extensions.bots.commandbot.commands.BotCommand
org.telegram.telegrambots.extensions.bots.commandbot.commands.DefaultBotCommand
- All Implemented Interfaces:
IBotCommand
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
ConstructorsConstructorDescriptionDefaultBotCommand(String commandIdentifier, String description) Construct a command -
Method Summary
Modifier and TypeMethodDescriptionabstract voidexecute(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 commandfinal voidexecute(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 commandvoidprocessMessage(org.telegram.telegrambots.meta.bots.AbsSender absSender, org.telegram.telegrambots.meta.api.objects.Message message, String[] arguments) Process the message and execute the commandMethods inherited from class org.telegram.telegrambots.extensions.bots.commandbot.commands.BotCommand
getCommandIdentifier, getDescription, toString
-
Constructor Details
-
DefaultBotCommand
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:
processMessagein interfaceIBotCommand- Overrides:
processMessagein classBotCommand- Parameters:
absSender- absSender to send messages overmessage- the message to processarguments- 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:BotCommandExecute the command- Specified by:
executein classBotCommand- Parameters:
absSender- absSender to send messages overuser- the user who sent the commandchat- the chat, to be able to send repliesarguments- 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 overuser- the user who sent the commandchat- the chat, to be able to send repliesmessageId- message id for interactionarguments- passed arguments
-