CommandPath

Represents a path of a command, each path component is delimited with a space, it is the same representation as JDA commands paths given in getFullCommandName. The different components are name, group and subcommand. This is mainly a utility class to avoid manipulating strings

Functions

Link copied to clipboard
Link copied to clipboard
abstract fun equals(o: Any): Boolean
Indicates if this command path is equal to another object
Link copied to clipboard
abstract fun getFullPath(): @NotNull String
Returns the full encoded path of this command path Each path component is joined with a space delimiter For a slash command such as /show me something, this would be show me something
abstract fun getFullPath(separator: Char): @NotNull String
Returns the full path with the specified separator.
Link copied to clipboard
abstract fun getGroup(): @Nullable String
Returns the subcommand group name of this command path For a slash command such as /show me something, this would be me
Link copied to clipboard
abstract fun getLastName(): @NotNull String
Returns the right-most name of this command path For a slash command such as /show me something, this would be something
Link copied to clipboard
abstract fun getName(): @NotNull String
Returns the top level name of this command path For a slash command such as /show me something, this would be show
Link copied to clipboard
abstract fun getNameAt(i: Int): @Nullable String
Return the name at the i index
Link copied to clipboard
abstract fun getNameCount(): Int
Returns the number of path components of this command path For a slash command such as /show me something, this would be 3For a slash command such as /tag info, this would be 2For a slash command such as /say, this would be 1
Link copied to clipboard
Returns the parent path of this command path For a slash command such as /show me something, this would be /show meFor a slash command such as /tag info, this would be /tagFor a slash command such as /say, this would be null
Link copied to clipboard
Returns the subcommand name of this command path For a slash command such as /show me something, this would be somethingFor a slash command such as /tag info, this would be info
Link copied to clipboard
open fun of(@NotNull components: @NotNull Array<@NotNull String>): @NotNull CommandPath
open fun of(@NotNull components: @NotNull List<@NotNull String>): @NotNull CommandPath
open fun of(@NotNull name: @NotNull String, @Nullable subname: @Nullable String): @NotNull CommandPath
open fun of(@NotNull name: @NotNull String, @Nullable group: @Nullable String, @Nullable subname: @Nullable String): @NotNull CommandPath
Link copied to clipboard
Link copied to clipboard
abstract fun startsWith(o: CommandPath): Boolean
Returns whether this command path starts with the supplied command path For example /show me something starts with /show me
Link copied to clipboard
abstract fun toString(): @NotNull String
Returns the JDA path representation of this CommandPath