Class DefaultBotCommand
Object
BotCommand
DefaultBotCommand
- All Implemented Interfaces:
IBotCommand
Bot command with message ID in execute method
- Author:
- Vadim Goroshevsky (@vadimgoroshevsky)
-
Field Summary
Fields inherited from class BotCommand
COMMAND_INIT_CHARACTER, COMMAND_PARAMETER_SEPARATOR_REGEXP -
Constructor Summary
ConstructorsConstructorDescriptionDefaultBotCommand(String commandIdentifier, String description) Construct a command -
Method Summary
Modifier and TypeMethodDescriptionabstract voidExecute the commandfinal voidExecute the commandvoidprocessMessage(TelegramClient telegramClient, Message message, String[] arguments) Process the message and execute the commandMethods inherited from class 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
Process the message and execute the command- Specified by:
processMessagein interfaceIBotCommand- Overrides:
processMessagein classBotCommand- Parameters:
telegramClient- Client to send messages overmessage- the message to processarguments- passed arguments
-
execute
Description copied from class:BotCommandExecute the command- Specified by:
executein classBotCommand- Parameters:
telegramClient- Client 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(TelegramClient telegramClient, User user, Chat chat, Integer messageId, String[] arguments) Execute the command- Parameters:
telegramClient- Client to send messages overuser- the user who sent the commandchat- the chat, to be able to send repliesmessageId- message id for interactionarguments- passed arguments
-