Class DeferrableInteractionEvent

    • Method Detail

      • acknowledge

        @Deprecated
        public Mono<Void> acknowledge()
        Deprecated.
        use deferReply() instead
        Acknowledges the interaction indicating a response will be edited later. The user sees a loading state, visible to all participants in the invoking channel. For an "only you can see this" response, see acknowledgeEphemeral(), or to include a message, reply(String).withEphemeral(true)
        Returns:
        A Mono where, upon successful completion, emits nothing; acknowledging the interaction and indicating a response will be edited later. The user sees a loading state. If an error is received, it is emitted through the Mono.
      • deferReply

        public discord4j.core.spec.InteractionCallbackSpecDeferReplyMono deferReply()
        Acknowledges the interaction indicating a response will be edited later. The user sees a loading state, visible to all participants in the invoking channel. For an "only you can see this" response, add withEphemeral(true), or to include a message, reply(String).withEphemeral(true).

        After calling deferReply, you are not allowed to call other acknowledging or reply method and have to either work with the initial reply using getReply(), editReply(), deleteReply(), or using followup messages with createFollowup(), editFollowup(Snowflake) or deleteFollowup(Snowflake).

        Returns:
        A InteractionCallbackSpecDeferReplyMono where, upon successful completion, emits nothing; acknowledging the interaction and indicating a response will be edited later. The user sees a loading state. If an error is received, it is emitted through it.
      • deferReply

        public Mono<Void> deferReply​(discord4j.core.spec.InteractionCallbackSpec spec)
        Acknowledges the interaction indicating a response will be edited later. The user sees a loading state, visible to all participants in the invoking channel.

        After calling deferReply, you are not allowed to call other acknowledging or reply method and have to either work with the initial reply using getReply(), editReply(), deleteReply(), or using followup messages with createFollowup(), editFollowup(Snowflake) or deleteFollowup(Snowflake).

        Parameters:
        spec - an immutable object that specifies how to build the reply message to the interaction
        Returns:
        A Mono where, upon successful completion, emits nothing; acknowledging the interaction and indicating a response will be edited later. The user sees a loading state. If an error is received, it is emitted through the Mono.
      • acknowledgeEphemeral

        @Deprecated
        public Mono<Void> acknowledgeEphemeral()
        Deprecated.
        Acknowledges the interaction indicating a response will be edited later. Only the invoking user sees a loading state.
        Returns:
        A Mono where, upon successful completion, emits nothing, acknowledging the interaction and indicating a response will be edited later. If an error is received, it is emitted through the Mono.
      • reply

        public discord4j.core.spec.InteractionApplicationCommandCallbackReplyMono reply()
        Requests to respond to the interaction with a message. Properties specifying how to build the reply message to the interaction can be set via the withXxx methods of the returned InteractionApplicationCommandCallbackReplyMono.

        For component interactions, like buttons or select menus, this method will create a new message. If you want to modify the message the component is on, see ComponentInteractionEvent.edit() or ComponentInteractionEvent.deferEdit().

        After calling reply, you are not allowed to call other acknowledging or reply method and have to either work with the initial reply using getReply(), editReply(), deleteReply(), or using followup messages with createFollowup(), editFollowup(Snowflake) or deleteFollowup(Snowflake).

        Returns:
        A InteractionApplicationCommandCallbackReplyMono where, upon successful completion, emits nothing; indicating the interaction response has been sent. If an error is received, it is emitted through the InteractionApplicationCommandCallbackMono.
      • reply

        public discord4j.core.spec.InteractionApplicationCommandCallbackReplyMono reply​(String content)
        Requests to respond to the interaction with a message initialized with the specified content. Properties specifying how to build the reply message to the interaction can be set via the withXxx methods of the returned InteractionApplicationCommandCallbackReplyMono.

        For component interactions, like buttons or select menus, this method will create a new message. If you want to modify the message the component is on, see ComponentInteractionEvent.edit() or ComponentInteractionEvent.deferEdit().

        After calling reply, you are not allowed to call other acknowledging or reply method and have to either work with the initial reply using getReply(), editReply(), deleteReply(), or using followup messages with createFollowup(), editFollowup(Snowflake) or deleteFollowup(Snowflake).

        Parameters:
        content - a string to populate the message with
        Returns:
        A InteractionApplicationCommandCallbackReplyMono where, upon successful completion, emits nothing; indicating the interaction response has been sent. If an error is received, it is emitted through the InteractionApplicationCommandCallbackMono.
      • reply

        public Mono<Void> reply​(discord4j.core.spec.InteractionApplicationCommandCallbackSpec spec)
        Requests to respond to the interaction with a message.

        For component interactions, like buttons or select menus, this method will create a new message. If you want to modify the message the component is on, see ComponentInteractionEvent.edit() or ComponentInteractionEvent.deferEdit().

        After calling reply, you are not allowed to call other acknowledging or reply method and have to either work with the initial reply using getReply(), editReply(), deleteReply(), or using followup messages with createFollowup(), editFollowup(Snowflake) or deleteFollowup(Snowflake).

        Parameters:
        spec - an immutable object that specifies how to build the reply message to the interaction
        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.
      • editReply

        public discord4j.core.spec.InteractionReplyEditMono editReply​(String content)
        Edits the initial reply sent when accepting this interaction with the given message content.

        For component interactions, like buttons or select menus, this method modifies the message depending on the initial response method chosen: if deferReply() or reply() was used, the new message created with the reply; if ComponentInteractionEvent.edit() or ComponentInteractionEvent.deferEdit() was used, this method will modify the message the component is on.

        Parameters:
        content - a string to update the message with
        Returns:
        a InteractionReplyEditMono where, upon successful completion, emits the updated message. If an error is received, it is emitted through the InteractionReplyEditMono.
      • editReply

        public discord4j.core.spec.InteractionReplyEditMono editReply()
        Edits the initial reply sent when accepting this interaction. Properties specifying how to build the edit message request can be set via the withXxx methods of the returned InteractionReplyEditMono.

        For component interactions, like buttons or select menus, this method modifies the message depending on the initial response method chosen: if deferReply() or reply() was used, the new message created with the reply; if ComponentInteractionEvent.edit() or ComponentInteractionEvent.deferEdit() was used, this method will modify the message the component is on.

        Returns:
        a InteractionReplyEditMono where, upon successful completion, emits the updated message. If an error is received, it is emitted through the InteractionReplyEditMono.
      • editReply

        public Mono<Message> editReply​(discord4j.core.spec.InteractionReplyEditSpec spec)
        Edits the initial reply sent when accepting this interaction with the given spec contents.

        For component interactions, like buttons or select menus, this method modifies the message depending on the initial response method chosen: if deferReply() or reply() was used, the new message created with the reply; if ComponentInteractionEvent.edit() or ComponentInteractionEvent.deferEdit() was used, this method will modify the message the component is on.

        Parameters:
        spec - an immutable object that specifies how to edit the initial reply
        Returns:
        a Mono where, upon successful completion, emits the updated message. If an error is received, it is emitted through the Mono.
      • getReply

        public Mono<Message> getReply()
        Returns the initial reply to this interaction.
        Returns:
        a Mono where, upon successful completion, emits the initial reply message. If an error is received, it is emitted through the Mono.
      • deleteReply

        public Mono<Void> deleteReply()
        Deletes the initial reply to this interaction.
        Returns:
        a Mono where, upon successful initial reply deletion, emits nothing indicating completion. If an error is received, it is emitted through the Mono.
      • createFollowup

        public discord4j.core.spec.InteractionFollowupCreateMono createFollowup()
        Creates a follow-up message to this interaction. Properties specifying how to build the follow-up message can be set via the withXxx methods of the returned InteractionFollowupCreateMono.
        Returns:
        a InteractionFollowupCreateMono where, upon successful completion, emits the resulting follow-up message. If an error is received, it is emitted through the InteractionApplicationCommandCallbackMono.
      • createFollowup

        public discord4j.core.spec.InteractionFollowupCreateMono createFollowup​(String content)
        Creates a follow-up message to this interaction with the given message content.
        Parameters:
        content - a string to populate the followup message with
        Returns:
        a InteractionFollowupCreateMono where, upon successful completion, emits the resulting follow-up message. If an error is received, it is emitted through the InteractionApplicationCommandCallbackMono.
      • createFollowup

        public Mono<Message> createFollowup​(discord4j.core.spec.InteractionFollowupCreateSpec spec)
        Creates a follow-up message to this interaction.
        Parameters:
        spec - an immutable object that specifies how to build the follow-up message
        Returns:
        a Mono where, upon successful completion, emits the resulting follow-up message. If an error is received, it is emitted through the Mono.
      • editFollowup

        public discord4j.core.spec.InteractionFollowupEditMono editFollowup​(Snowflake messageId)
        Edits a follow-up message to this interaction. Properties specifying how to edit the follow-up message can be set via the withXxx methods of the returned InteractionFollowupEditMono.
        Parameters:
        messageId - the follow-up message ID to edit
        Returns:
        a InteractionFollowupEditMono where, upon successful completion, emits the updated follow-up message. If an error is received, it is emitted through the InteractionFollowupEditMono.
      • editFollowup

        public Mono<Message> editFollowup​(Snowflake messageId,
                                          discord4j.core.spec.InteractionReplyEditSpec spec)
        Edits a follow-up message to this interaction.
        Parameters:
        messageId - the follow-up message ID to edit
        spec - an immutable object that specifies how to build the edited follow-up message
        Returns:
        a Mono where, upon successful completion, emits the updated follow-up message. If an error is received, it is emitted through the Mono.
      • deleteFollowup

        public Mono<Void> deleteFollowup​(Snowflake messageId)
        Delete a followup message created under this interaction.
        Parameters:
        messageId - the message ID to be deleted
        Returns:
        a Mono where, upon successful message deletion, returns a completion signal. If an error is received, it is emitted through the Mono.