Class ModalSubmitInteractionEvent


@Experimental public class ModalSubmitInteractionEvent extends ComponentInteractionEvent
Dispatched when a user has pressed submit on a modal presented to them earlier

You are required to respond to this interaction within a three-second window by using one of the following:

After the initial response is complete, you can work with the interaction using the following methods: You can also work with followup messages using:

This is not directly dispatched by Discord, but is a utility specialization of InteractionCreateEvent.

See Also:
  • Constructor Details

  • Method Details

    • getCustomId

      public String getCustomId()
      Gets the developer defined custom ID of this modal
      Overrides:
      getCustomId in class ComponentInteractionEvent
      Returns:
      The custom ID of this modal
      See Also:
    • getComponents

      public List<MessageComponent> getComponents()
      Gets the components from the modal
      Returns:
      The components from the modal
    • getComponents

      public <T extends MessageComponent> List<T> getComponents(Class<T> componentType)
      Gets the components from the modal that match the given component type.
      Parameters:
      componentType - the modal component type to return
      Returns:
      The components from the modal
    • presentModal

      public Mono<Void> presentModal(discord4j.core.spec.InteractionPresentModalSpec spec)
      Description copied from class: DeferrableInteractionEvent
      Requests to respond to the interaction by presenting a modal for the user to fill out and submit with the given spec contents. Once the user submits the modal, it will be received as a new ModalSubmitInteractionEvent.
      Overrides:
      presentModal in class DeferrableInteractionEvent
      Parameters:
      spec - an immutable object that specifies how to present the modal window
      Returns:
      A Mono where, upon successful completion, emits nothing; indicating the interaction response has been sent. If an error is received, it is emitted through the Mono.