Interface ICommandReference
- All Superinterfaces:
Formattable,IMentionable,ISnowflake
- All Known Subinterfaces:
Command
- All Known Implementing Classes:
Command.Subcommand,Command.SubcommandGroup,SlashCommandReference
Represents a mentionable slash command.
-
Method Summary
Methods inherited from interface net.dv8tion.jda.api.entities.IMentionable
formatToMethods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
-
Method Details
-
getName
Returns the name of the slash command.
If used on a subcommand, it returns the subcommand name. And when used on a subcommand group, it returns the group name.
You can usegetFullCommandName()to get the full name including base command and group.- Returns:
- the name of the slash command
-
getFullCommandName
Returns the full command name, including possible subcommand name and subcommand group name.
This is the name shown on messages or when writing the command in the text input.Examples:
- When used on a normal base command, the full name is the name itself, as in the name
"ban"is equal to the full name"ban". - When used on a subcommand
"ban", of the base command"mod", the full name resolves to"mod ban" - When the subcommand is part of a subcommand group,
"action"it resolves to"mod action ban"
- Returns:
- the full command name
- When used on a normal base command, the full name is the name itself, as in the name
-
getAsMention
Retrieve a Mention for this Entity. For the publicRole(@everyone), this will return the literal string"@everyone".This will only work on slash commands!
- Specified by:
getAsMentionin interfaceIMentionable- Returns:
- A resolvable mention.
- Throws:
IllegalStateException- If the command is not a slash command (i.e. not of typeCommand.Type.SLASH)
-