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 int
The maximum length a custom ID can have (100)static final int
The maximum number of files the user can upload at once (10) -
Method Summary
Modifier and TypeMethodDescriptionstatic AttachmentUpload.Builder
Creates a newAttachmentUpload.Builder
with the provided custom ID.int
The maximum amount of attachments the user can send.int
The minimum amount of attachments the user must send.boolean
Whether the user must send attachments.static AttachmentUpload
Creates a newAttachmentUpload
with 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, isModalCompatible
Methods 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.Builder
with 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
- IfcustomId
isnull
, blank, or longer than 100 characters
-
of
Creates a newAttachmentUpload
with 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
- IfcustomId
isnull
, blank, or longer than 100 characters
-
withUniqueId
Description copied from interface:Component
Creates 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:
withUniqueId
in interfaceComponent
- Specified by:
withUniqueId
in interfaceICustomId
- Specified by:
withUniqueId
in 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
AttachmentUpload
with the range set to[2 ; 2]
, meaning you accept either 0 attachments, or 2.- Returns:
true
if files must be uploaded,false
if not
-