Class SlashCommandReference
java.lang.Object
net.dv8tion.jda.api.interactions.commands.SlashCommandReference
- All Implemented Interfaces:
Formattable
,IMentionable
,ISnowflake
,ICommandReference
Represents a slash command mention, such as
</ban soft:1021082477038678126>
-
Constructor Summary
ConstructorDescriptionSlashCommandReference
(String name, String subcommandGroup, String subcommand, long id) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the full command name, including possible subcommand name and subcommand group name.long
The Snowflake id of this entity.getName()
Returns the name of the slash command.Returns the subcommand group of the slash commandReturns the subcommand of the slash commandint
hashCode()
toString()
Methods inherited from interface net.dv8tion.jda.api.interactions.commands.ICommandReference
getAsMention
Methods inherited from interface net.dv8tion.jda.api.entities.IMentionable
formatTo
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getTimeCreated
-
Constructor Details
-
SlashCommandReference
-
-
Method Details
-
getIdLong
public long getIdLong()Description copied from interface:ISnowflake
The Snowflake id of this entity. This is unique to every entity and will never change.- Specified by:
getIdLong
in interfaceISnowflake
- Returns:
- Long containing the Id.
-
getName
Description copied from interface:ICommandReference
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 useICommandReference.getFullCommandName()
to get the full name including base command and group.- Specified by:
getName
in interfaceICommandReference
- Returns:
- the name of the slash command
-
getSubcommandName
Returns the subcommand of the slash command- Returns:
- the subcommand of the slash command
-
getSubcommandGroup
Returns the subcommand group of the slash command- Returns:
- the subcommand group of the slash command
-
getFullCommandName
Description copied from interface:ICommandReference
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"
- Specified by:
getFullCommandName
in interfaceICommandReference
- Returns:
- the full command name
- When used on a normal base command, the full name is the name itself, as in the name
-
toString
-
equals
-
hashCode
public int hashCode()
-