public abstract class BotCommand extends Object implements IBotCommand
| Modifier and Type | Field and Description |
|---|---|
static String |
COMMAND_INIT_CHARACTER |
static String |
COMMAND_PARAMETER_SEPARATOR_REGEXP |
| Constructor and Description |
|---|
BotCommand(String commandIdentifier,
String description)
Construct a command
|
| Modifier and Type | Method and Description |
|---|---|
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,
String[] arguments)
Execute the command
|
String |
getCommandIdentifier()
Get the identifier of this command
|
String |
getDescription()
Get the description of this command
|
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
|
String |
toString() |
public static final String COMMAND_INIT_CHARACTER
public static final String COMMAND_PARAMETER_SEPARATOR_REGEXP
public final String getCommandIdentifier()
getCommandIdentifier in interface IBotCommandpublic final String getDescription()
getDescription in interface IBotCommandpublic void processMessage(org.telegram.telegrambots.meta.bots.AbsSender absSender, org.telegram.telegrambots.meta.api.objects.Message message, String[] arguments)
processMessage in interface IBotCommandabsSender - absSender to send messages overmessage - the message to processarguments - passed argumentspublic 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, String[] arguments)
absSender - absSender to send messages overuser - the user who sent the commandchat - the chat, to be able to send repliesarguments - passed argumentsCopyright © 2018. All rights reserved.