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
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
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract 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 commandvoidexecute(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 command-
Methods inherited from class org.telegram.telegrambots.extensions.bots.commandbot.commands.BotCommand
getCommandIdentifier, getDescription, toString
-
-
-
-
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:
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
-
-