Class BaseCommand<T extends BaseCommand<T>>
- java.lang.Object
-
- net.dv8tion.jda.api.interactions.commands.build.BaseCommand<T>
-
- All Implemented Interfaces:
SerializableData
- Direct Known Subclasses:
CommandData
,SubcommandData
public abstract class BaseCommand<T extends BaseCommand<T>> extends Object implements SerializableData
-
-
Constructor Summary
Constructors Constructor Description BaseCommand(String name, String description)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDescription()
The configured descriptionString
getName()
The configured nameList<OptionData>
getOptions()
The options for this command.T
setDescription(String description)
Configure the descriptionT
setName(String name)
Configure the nameDataObject
toData()
SerializedDataObject
for this object.
-
-
-
Method Detail
-
setName
@Nonnull public T setName(@Nonnull String name)
Configure the name- Parameters:
name
- The lowercase alphanumeric (with dash) name, 1-32 characters- Returns:
- The builder, for chaining
- Throws:
IllegalArgumentException
- If the name is null, not alphanumeric, or not between 1-32 characters
-
setDescription
@Nonnull public T setDescription(@Nonnull String description)
Configure the description- Parameters:
description
- The description, 1-100 characters- Returns:
- The builder, for chaining
- Throws:
IllegalArgumentException
- If the name is null or not between 1-100 characters
-
getDescription
@Nonnull public String getDescription()
The configured description- Returns:
- The description
-
getOptions
@Nonnull public List<OptionData> getOptions()
The options for this command.- Returns:
- Immutable list of
OptionData
-
toData
@Nonnull public DataObject toData()
Description copied from interface:SerializableData
SerializedDataObject
for this object.- Specified by:
toData
in interfaceSerializableData
- Returns:
DataObject
-
-