Interface CommandManager
public sealed interface CommandManager
Interface that provides methods to manage commands.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleancommandExists(@NotNull String commandName) Checks if a Command exists.voidExecutes a Command.extractCommand(String text) Extracts a Command from a text string.@Nullable CommandgetCommand(@NotNull String commandName) Returns a Command by its name.static @NotNull CommandManagernewCommandManager(@NotNull TelegramBot bot) voidregisterCommand(@NotNull Command command) Registers a new command from a Command instance.
-
Method Details
-
newCommandManager
@Internal @NotNull static @NotNull CommandManager newCommandManager(@NotNull @NotNull TelegramBot bot) -
registerCommand
Registers a new command from a Command instance.- Parameters:
command- The command to be registered.
-
getCommand
-
commandExists
Checks if a Command exists.- Parameters:
commandName- The name of the Command to check.- Returns:
- True if the Command exists, false otherwise.
-
execute
-
extractCommand
-