Interface CommandHelpWriter<T>

Type Parameters:
T - The command help entry type. If we want to merely use strings as what is generated for each command, this would be a String.

Similarly, more complex types, such as chat components, can have this type as the appropriate chat component type.


public interface CommandHelpWriter<T>
A writer for generating entries for help commands.
  • Method Details

    • generate

      @Nullable T generate(@NotNull @NotNull ExecutableCommand command, @NotNull @NotNull CommandActor actor)
      Generates a command help entry for the specified command
      Parameters:
      command - Command to generate for. It is generally advisable to do permission checks as well as other filters such as ExecutableCommand.isSecret().
      actor - Actor to generate for
      Returns:
      The generated help entry. If null, this entry will not appear on the generated help list.
    • ignore

      default CommandHelpWriter<T> ignore(@NotNull @NotNull Predicate<ExecutableCommand> predicate)
      Ignores any command that matches the specified predicate
      Parameters:
      predicate - Predicate to test for
      Returns:
      The command help writer that filters according to that predicate.
    • only

      default CommandHelpWriter<T> only(@NotNull @NotNull Predicate<ExecutableCommand> predicate)
      Writes commands that only matches the specified predicate
      Parameters:
      predicate - Predicate to test for
      Returns:
      The command help writer that only allows elements that match the predicate.