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 java.lang.Object implements SerializableData
-
-
Constructor Summary
Constructors Constructor Description BaseCommand(java.lang.String name, java.lang.String description)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDescription()
The configured descriptionjava.lang.String
getName()
The configured namejava.util.List<OptionData>
getOptions()
The options for this command.T
setDescription(java.lang.String description)
Configure the descriptionT
setName(java.lang.String name)
Configure the nameDataObject
toData()
SerializedDataObject
for this object.
-
-
-
Method Detail
-
setName
@Nonnull public T setName(@Nonnull java.lang.String name)
Configure the name- Parameters:
name
- The lowercase alphanumeric (with dash) name, 1-32 characters- Returns:
- The builder, for chaining
- Throws:
java.lang.IllegalArgumentException
- If the name is null, not alphanumeric, or not between 1-32 characters
-
setDescription
@Nonnull public T setDescription(@Nonnull java.lang.String description)
Configure the description- Parameters:
description
- The description, 1-100 characters- Returns:
- The builder, for chaining
- Throws:
java.lang.IllegalArgumentException
- If the name is null or not between 1-100 characters
-
getName
@Nonnull public java.lang.String getName()
The configured name- Returns:
- The name
-
getDescription
@Nonnull public java.lang.String getDescription()
The configured description- Returns:
- The description
-
getOptions
@Nonnull public java.util.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
-
-