Interface Separator
- All Superinterfaces:
Component
,ContainerChildComponent
,MessageTopLevelComponent
- All Known Implementing Classes:
SeparatorImpl
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 enum
Represents 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 Separator
create
(boolean isDivider, Separator.Spacing spacing) Constructs a newSeparator
from the given content.static Separator
createDivider
(Separator.Spacing spacing) Constructs a new, visibleSeparator
from the given content.static Separator
createInvisible
(Separator.Spacing spacing) Constructs a new, invisibleSeparator
from the given content.The spacing of this separator.boolean
Whether this separator is visible or not.withDivider
(boolean divider) Creates a newSeparator
with the provided divider status.withSpacing
(Separator.Spacing spacing) Creates a newSeparator
with 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, visibleSeparator
from the given content.
This is equivalent tocreate(true, spacing)
.- Parameters:
spacing
- The spacing provided by the separator- Returns:
- The new
Separator
- Throws:
IllegalArgumentException
- Ifnull
is provided
-
createInvisible
Constructs a new, invisibleSeparator
from the given content.
This is equivalent tocreate(false, spacing)
.- Parameters:
spacing
- The spacing provided by the separator- Returns:
- The new
Separator
- Throws:
IllegalArgumentException
- Ifnull
is provided
-
create
Constructs a newSeparator
from the given content.- Parameters:
isDivider
- Whether the separator is visiblespacing
- The spacing provided by the separator- Returns:
- The new
Separator
- Throws:
IllegalArgumentException
- Ifnull
is provided
-
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 interfaceContainerChildComponent
- Specified by:
withUniqueId
in interfaceMessageTopLevelComponent
- Parameters:
uniqueId
- The new ID; must be higher or equal to 1- Returns:
- The new component
-
withDivider
Creates a newSeparator
with the provided divider status.- Parameters:
divider
- The new divider status,true
to make it visible,false
is invisible- Returns:
- The new
Separator
-
withSpacing
Creates a newSeparator
with the provided spacing.- Parameters:
spacing
- The new spacing- Returns:
- The new
Separator
-
isDivider
boolean isDivider()Whether this separator is visible or not.- Returns:
true
if this separate is a divider, and thus visible,false
otherwise
-
getSpacing
The spacing of this separator.- Returns:
- The spacing
-