public class HelpCommand extends ManCommand
IManCommand interface to provide an extended description.COMMAND_INIT_CHARACTER, COMMAND_PARAMETER_SEPARATOR_REGEXP| Constructor and Description |
|---|
HelpCommand()
Create a Help command with the standard Arguments.
|
HelpCommand(String commandIdentifier,
String description,
String extendedDescription)
Creates a Help Command with custom identifier, description and extended Description
|
| Modifier and Type | Method and Description |
|---|---|
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
|
static String |
getHelpText(Collection<IBotCommand> botCommands)
Returns the command and description of all supplied commands as a formatted String
|
static String |
getHelpText(IBotCommand... botCommands)
Returns the command and description of all supplied commands as a formatted String
|
static String |
getHelpText(ICommandRegistry registry)
Returns the command and description of all supplied commands as a formatted String
|
static String |
getManText(IBotCommand command)
Reads the extended Description from a BotCommand.
|
static String |
getManText(IManCommand command)
Reads the extended Description from a BotCommand;
|
getExtendedDescription, toMangetCommandIdentifier, getDescription, processMessage, toStringpublic HelpCommand()
public HelpCommand(String commandIdentifier, String description, String extendedDescription)
commandIdentifier - the unique identifier of this command (e.g. the command string to enter into chat)description - the description of this commandextendedDescription - The extended Description for the Command, should provide detailed information about arguments and possible optionspublic static String getHelpText(IBotCommand... botCommands)
botCommands - the Commands that should be included in the Stringpublic static String getHelpText(Collection<IBotCommand> botCommands)
botCommands - a collection of commands that should be included in the Stringpublic static String getHelpText(ICommandRegistry registry)
registry - a commandRegistry which commands are formatted into the Stringpublic static String getManText(IBotCommand command)
IManCommand, it calls toString();command - a command the extended Descriptions is read frompublic static String getManText(IManCommand command)
command - a command the extended Descriptions is read frompublic 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)
BotCommandexecute in class BotCommandabsSender - 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.