Interface TextDisplay
- All Superinterfaces:
Component,ContainerChildComponent,MessageTopLevelComponent,ModalTopLevelComponent,SectionContentComponent
public interface TextDisplay
extends Component, MessageTopLevelComponent, ModalTopLevelComponent, ContainerChildComponent, SectionContentComponent
A component to display text, supports Markdown.
This component has no content length limit, however, you are still limited to the 4000 total characters, as imposed by components V2.
Requirements: Components V2 needs to be enabled!
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.dv8tion.jda.api.components.Component
Component.Type -
Method Summary
Modifier and TypeMethodDescriptionThe content of thisTextDisplay.static TextDisplayConstructs a newTextDisplayfrom the given content.static TextDisplayConstructs a newTextDisplayfrom the given format string and arguments.withContent(String content) Creates a newTextDisplaywith the specified content.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
-
of
Constructs a newTextDisplayfrom the given content.- Parameters:
content- The content of the text display- Returns:
- The new
TextDisplay - Throws:
IllegalArgumentException- If the content isnull, blank or empty
-
ofFormat
Constructs a newTextDisplayfrom the given format string and arguments.- Parameters:
format- The content to format with the following argumentsargs- The arguments to format the content with, if there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero. The behaviour on anullargument depends on the conversion.- Returns:
- The new
TextDisplay - Throws:
IllegalArgumentException- If the format string isnull, or the resulting content is blankIllegalFormatException- If the format string contains an illegal syntax, a format specifier that is incompatible with the given arguments, insufficient arguments given the format string, or other illegal conditions. For specification of all possible formatting errors, see the Details section of the formatter class specification.
-
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- Specified by:
withUniqueIdin interfaceModalTopLevelComponent- Specified by:
withUniqueIdin interfaceSectionContentComponent- Parameters:
uniqueId- The new ID; must be higher or equal to 1- Returns:
- The new component
-
withContent
Creates a newTextDisplaywith the specified content.While there are no per-component limit, you are still limited to the 4000 total character limit.
- Parameters:
content- The new content- Returns:
- The new
TextDisplay
-
getContent
The content of thisTextDisplay.- Returns:
- The content
-