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 user is not granted the permission to use the command, the command will fail with a PermissionDeniedException. If the context is outside the scope of the command, nothing happens and the command completes empty.
      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
    • toString

      public String toString()
      Overrides:
      toString in class Object