Interface Separator
- All Superinterfaces:
Component,ContainerChildComponent,MessageTopLevelComponent
A component to separate content vertically, you can change its size and make it invisible.
Requirements: Components V2 needs to be enabled!
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumRepresents the amount of spacing a separator will create.Nested classes/interfaces inherited from interface net.dv8tion.jda.api.components.Component
Component.Type -
Method Summary
Modifier and TypeMethodDescriptionstatic Separatorcreate(boolean isDivider, Separator.Spacing spacing) Constructs a newSeparatorfrom the given content.static SeparatorcreateDivider(Separator.Spacing spacing) Constructs a new, visibleSeparatorfrom the given content.static SeparatorcreateInvisible(Separator.Spacing spacing) Constructs a new, invisibleSeparatorfrom the given content.The spacing of this separator.booleanWhether this separator is visible or not.withDivider(boolean divider) Creates a newSeparatorwith the provided divider status.withSpacing(Separator.Spacing spacing) Creates a newSeparatorwith the provided spacing.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
-
Method Details
-
createDivider
Constructs a new, visibleSeparatorfrom the given content.
This is equivalent tocreate(true, spacing).- Parameters:
spacing- The spacing provided by the separator- Returns:
- The new
Separator - Throws:
IllegalArgumentException- Ifnullis provided
-
createInvisible
Constructs a new, invisibleSeparatorfrom the given content.
This is equivalent tocreate(false, spacing).- Parameters:
spacing- The spacing provided by the separator- Returns:
- The new
Separator - Throws:
IllegalArgumentException- Ifnullis provided
-
create
Constructs a newSeparatorfrom the given content.- Parameters:
isDivider- Whether the separator is visiblespacing- The spacing provided by the separator- Returns:
- The new
Separator - Throws:
IllegalArgumentException- Ifnullis provided
-
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 interfaceContainerChildComponent- Specified by:
withUniqueIdin interfaceMessageTopLevelComponent- Parameters:
uniqueId- The new ID; must be higher or equal to 1- Returns:
- The new component
-
withDivider
Creates a newSeparatorwith the provided divider status.- Parameters:
divider- The new divider status,trueto make it visible,falseis invisible- Returns:
- The new
Separator
-
withSpacing
Creates a newSeparatorwith the provided spacing.- Parameters:
spacing- The new spacing- Returns:
- The new
Separator
-
isDivider
boolean isDivider()Whether this separator is visible or not.- Returns:
trueif this separate is a divider, and thus visible,falseotherwise
-
getSpacing
The spacing of this separator.- Returns:
- The spacing
-