Class ExecutableCommand

java.lang.Object
com.github.alex1304.ultimategdbot.api.command.ExecutableCommand

public class ExecutableCommand
extends Object
Represents a command ready to be executed, meaning that the context and the error handler of the command are already defined.
  • Constructor Details

  • Method Details

    • execute

      public reactor.core.publisher.Mono<Void> execute()
      Executes the command by taking into account the context and by applying the error handler. Scope and permission checks are performed here. If the command is not in scope, the execution completes immediately without any side effect. If the user is not granted the permission to use the command, the command will fail with a PermissionDeniedException.
      Returns:
      a Mono completing when the command execution is complete. Errors caused by a failed permission check or an abnormal termination of the command will be forwarded through this Mono.
    • getCommand

      public Command getCommand()
      Gets the underlying command instance.
      Returns:
      the command
    • getContext

      public Context getContext()
      Gets the context of the command.
      Returns:
      the context
    • getErrorHandler

      public CommandErrorHandler getErrorHandler()
      Gets the error handler applied to this command.
      Returns:
      the error handler