Interface InteractionHandler

All Known Implementing Classes:
FollowupInteractionHandler

@Experimental public interface InteractionHandler
An interaction handler is responsible for providing an initial response and followup for incoming interactions.
  • Method Summary

    Modifier and Type
    Method
    Description
    Return a reactive sequence to work with an interaction token after an initial response has been sent.
    discord4j.discordjson.json.InteractionResponseData
    Return the response to be sent to Discord on interaction create.
  • Method Details

    • response

      discord4j.discordjson.json.InteractionResponseData response()
      Return the response to be sent to Discord on interaction create.
      Returns:
      the raw data to build an initial interaction response
    • onInteractionResponse

      Publisher<?> onInteractionResponse(InteractionResponse response)
      Return a reactive sequence to work with an interaction token after an initial response has been sent.
      Parameters:
      response - a handler with all common actions to derive the asynchronous followup sequence
      Returns:
      a publisher, like a Mono or Flux to be subscribed for the duration of the interaction token, after which will be cancelled through Flux.take(Duration) semantics.