Class ParentCommand

java.lang.Object
com.reign.kat.lib.command.Command
com.reign.kat.lib.command.ParentCommand
Direct Known Subclasses:
ConfigParentCommand

@Deprecated @ReplaceWith("com.reign.kat.lib.command.Command") public abstract class ParentCommand extends Command
Deprecated.
ParentCommand A command which can have multiple subcommands attached to it. Acts like a regular command, with extra methods for children commands. Add a new child command with `registerSubcommand(command);`, this can then be called in Discord with `!command subcommand`.
  • Constructor Details

    • ParentCommand

      public ParentCommand(String[] aliases, String primaryAlias, String description)
      Deprecated.
  • Method Details

    • registerSubcommand

      public void registerSubcommand(Command command)
      Deprecated.
      Overrides:
      registerSubcommand in class Command
    • getSubcommand

      public Command getSubcommand(String alias)
      Deprecated.
      Overrides:
      getSubcommand in class Command
    • executeCommands

      public void executeCommands(Context ctx, List<String> args) throws Exception
      Deprecated.
      Calls the parent command before calling a subcommand
      Overrides:
      executeCommands in class Command
      Parameters:
      ctx - Context of the command
      args - string args to convert into Converters
      Throws:
      Exception
    • getSignature

      public String getSignature()
      Deprecated.
      Description copied from class: Command
      Returns the argument signature for the command.
      For example, the command
      !kick UserID opt:reason

      would build a signature string of:-
      kick <user:User> [reason: String]
      Overrides:
      getSignature in class Command
      Returns:
      String signature
    • execute

      public abstract void execute(Context ctx, CommandParameters args) throws Exception
      Deprecated.
      Specified by:
      execute in class Command
      Throws:
      Exception