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 StringgetDescription()The configured descriptionStringgetName()The configured nameList<OptionData>getOptions()The options for this command.TsetDescription(String description)Configure the descriptionTsetName(String name)Configure the nameDataObjecttoData()SerializedDataObjectfor 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:SerializableDataSerializedDataObjectfor this object.- Specified by:
toDatain interfaceSerializableData- Returns:
DataObject
-
-