Interface IComponentUnion

All Superinterfaces:
Component
All Known Subinterfaces:
ActionRowChildComponentUnion, ContainerChildComponentUnion, MessageTopLevelComponentUnion, ModalTopLevelComponentUnion, SectionAccessoryComponentUnion, SectionContentComponentUnion
All Known Implementing Classes:
ActionRowImpl, ButtonImpl, ContainerImpl, EntitySelectMenuImpl, FileDisplayFileUpload, FileDisplayImpl, MediaGalleryImpl, SectionImpl, SelectMenuImpl, SeparatorImpl, StringSelectMenuImpl, TextDisplayImpl, TextInputImpl, ThumbnailFileUpload, ThumbnailImpl, UnknownComponentImpl

public interface IComponentUnion extends Component
Base interface for Component union types.
See Also:
  • Method Details

    • isUnknownComponent

      default boolean isUnknownComponent()
      Whether this component is an UnknownComponent.

      Unknown components have restrictions, see UnknownComponent for details.

      This is equivalent to getType() == Type.UNKNOWN.

      Returns:
      true if this is an unknown component, false if not.
      See Also:
    • withUniqueId

      @Nonnull IComponentUnion withUniqueId(int uniqueId)
      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 interface Component
      Parameters:
      uniqueId - The new ID; must be higher or equal to 1
      Returns:
      The new component