Class CommandResponder


  • public class CommandResponder
    extends java.lang.Object
    A class that takes methods out from SlashCommandInteraction that are to respond to a command

    CommandHandler returns it with various events to be able to respond them

    • Constructor Summary

      Constructors 
      Constructor Description
      CommandResponder​(org.javacord.api.interaction.SlashCommandInteraction interaction)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.javacord.api.interaction.callback.InteractionFollowupMessageBuilder followUp()
      Creates a followup message builder to send the final result of late response
      java.util.concurrent.CompletableFuture<org.javacord.api.interaction.callback.InteractionOriginalResponseUpdater> respondLater()
      Creates an updater that listens for the response In this case a waiting message can be sent to the user NOTE: Late responses need to be sent within 15 minutes, otherwise Discord drops it
      java.util.concurrent.CompletableFuture<org.javacord.api.interaction.callback.InteractionOriginalResponseUpdater> respondLaterEphemeral()
      Creates an ephemeral updater that listens for the response In this case a waiting message can be sent to the user NOTE: Late responses need to be sent within 15 minutes, otherwise Discord drops it
      org.javacord.api.interaction.callback.InteractionImmediateResponseBuilder respondNow()
      Creates a responder to respond immediately to the command
      java.util.concurrent.CompletableFuture<java.lang.Void> respondWithModal​(java.lang.String customId, java.lang.String title, java.util.List<org.javacord.api.entity.message.component.HighLevelComponent> highLevelComponents)
      Creates a responder to respond with a modal to the command
      java.util.concurrent.CompletableFuture<java.lang.Void> respondWithModal​(java.lang.String customId, java.lang.String title, org.javacord.api.entity.message.component.HighLevelComponent... highLevelComponents)
      Creates a responder to respond with a modal to the command
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CommandResponder

        public CommandResponder​(org.javacord.api.interaction.SlashCommandInteraction interaction)
    • Method Detail

      • respondLater

        public java.util.concurrent.CompletableFuture<org.javacord.api.interaction.callback.InteractionOriginalResponseUpdater> respondLater()
        Creates an updater that listens for the response In this case a waiting message can be sent to the user NOTE: Late responses need to be sent within 15 minutes, otherwise Discord drops it
        Returns:
        the response updater
      • respondLaterEphemeral

        public java.util.concurrent.CompletableFuture<org.javacord.api.interaction.callback.InteractionOriginalResponseUpdater> respondLaterEphemeral()
        Creates an ephemeral updater that listens for the response In this case a waiting message can be sent to the user NOTE: Late responses need to be sent within 15 minutes, otherwise Discord drops it
        Returns:
        the response updater
      • respondNow

        public org.javacord.api.interaction.callback.InteractionImmediateResponseBuilder respondNow()
        Creates a responder to respond immediately to the command
        Returns:
        the immediate responder builder
      • followUp

        public org.javacord.api.interaction.callback.InteractionFollowupMessageBuilder followUp()
        Creates a followup message builder to send the final result of late response
        Returns:
        the followup message builder
      • respondWithModal

        public java.util.concurrent.CompletableFuture<java.lang.Void> respondWithModal​(java.lang.String customId,
                                                                                       java.lang.String title,
                                                                                       org.javacord.api.entity.message.component.HighLevelComponent... highLevelComponents)
        Creates a responder to respond with a modal to the command
        Returns:
        the CompletableFuture that completes when the modal is opened
      • respondWithModal

        public java.util.concurrent.CompletableFuture<java.lang.Void> respondWithModal​(java.lang.String customId,
                                                                                       java.lang.String title,
                                                                                       java.util.List<org.javacord.api.entity.message.component.HighLevelComponent> highLevelComponents)
        Creates a responder to respond with a modal to the command
        Returns:
        the CompletableFuture that completes when the modal is opened