Interface AttachmentUpload
- All Superinterfaces:
Component,ICustomId,LabelChildComponent
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface net.dv8tion.jda.api.components.Component
Component.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe maximum length a custom ID can have (100)static final intThe maximum number of files the user can upload at once (10) -
Method Summary
Modifier and TypeMethodDescriptionstatic AttachmentUpload.BuilderCreates a newAttachmentUpload.Builderwith the provided custom ID.intThe maximum amount of attachments the user can send.intThe minimum amount of attachments the user must send.booleanWhether the user must send attachments.static AttachmentUploadCreates a newAttachmentUploadwith the provided custom ID.withUniqueId(int uniqueId) Creates a new component with the provided numeric ID.Methods inherited from interface net.dv8tion.jda.api.components.Component
getType, getUniqueId, isMessageCompatible, isModalCompatibleMethods inherited from interface net.dv8tion.jda.api.components.attribute.ICustomId
getCustomId
-
Field Details
-
MAX_UPLOADS
static final int MAX_UPLOADSThe maximum number of files the user can upload at once (10)- See Also:
-
ID_MAX_LENGTH
static final int ID_MAX_LENGTHThe maximum length a custom ID can have (100)- See Also:
-
-
Method Details
-
create
Creates a newAttachmentUpload.Builderwith the provided custom ID.
By default, the user will be required to submit a single attachment.- Parameters:
customId- The custom ID of this component, can be used to pass data, then read in an interaction- Returns:
- The new
AttachmentUpload.Builder - Throws:
IllegalArgumentException- IfcustomIdisnull, blank, or longer than 100 characters
-
of
Creates a newAttachmentUploadwith the provided custom ID.
The user will be required to submit a single attachment.- Parameters:
customId- The custom ID of this component, can be used to pass data, then read in an interaction- Returns:
- The new
AttachmentUpload - Throws:
IllegalArgumentException- IfcustomIdisnull, blank, or longer than 100 characters
-
withUniqueId
Description copied from interface:ComponentCreates a new component with the provided numeric ID.
If no ID is set, Discord will generate IDs incrementally starting from 1 and will not use existing IDs from the same message/modal.- Specified by:
withUniqueIdin interfaceComponent- Specified by:
withUniqueIdin interfaceICustomId- Specified by:
withUniqueIdin interfaceLabelChildComponent- Parameters:
uniqueId- The new ID; must be higher or equal to 1- Returns:
- The new component
-
getMinValues
int getMinValues()The minimum amount of attachments the user must send.- Returns:
- Minimum amount of attachments the user must send
-
getMaxValues
int getMaxValues()The maximum amount of attachments the user can send.- Returns:
- Maximum amount of attachments the user can send
-
isRequired
boolean isRequired()Whether the user must send attachments.This attribute is completely separate from the value range, for example you can have an optional
AttachmentUploadwith the range set to[2 ; 2], meaning you accept either 0 attachments, or 2.- Returns:
trueif files must be uploaded,falseif not
-