Interface CommandParser
public interface CommandParser
Interface for parsing commands.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull CommandParsernewCommandParser(@NotNull CommandManager commandManager) Static factory method for creating a new CommandParser.parse(TelegramBot bot, @NotNull User sender, @NotNull String userInput, Message message) Parses user input into a command.
-
Method Details
-
newCommandParser
@NotNull static @NotNull CommandParser newCommandParser(@NotNull @NotNull CommandManager commandManager) Static factory method for creating a new CommandParser.- Parameters:
commandManager- the CommandManager to be used by the CommandParser- Returns:
- a new CommandParserImpl instance
-
parse
CommandParser.Result parse(TelegramBot bot, @NotNull @NotNull User sender, @NotNull @NotNull String userInput, Message message) Parses user input into a command.- Parameters:
bot- the Bot instance that received the commandsender- the User who sent the commanduserInput- the user's input as a Stringmessage- the Message object containing the user's input- Returns:
- a Result object containing the parsed command
-