Interface ApplicationCommand

    • Method Detail

      • getId

        long getId()
        Gets the unique id of this command.
        Specified by:
        getId in interface DiscordEntity
        Returns:
        The unique id of this command.
        See Also:
        Discord docs
      • getApplicationId

        long getApplicationId()
        Gets the unique id of the application that this command belongs to.
        Returns:
        The unique application id.
      • getType

        ApplicationCommandType getType()
        Gets the type of this application command.
        Returns:
        The type of this command.
      • getName

        java.lang.String getName()
        Gets the name of this command.
        Returns:
        The name of this command.
      • getNameLocalizations

        java.util.Map<DiscordLocale,​java.lang.String> getNameLocalizations()
        Gets the name localizations of this command.
        Returns:
        The name localizations of this command.
      • getDescription

        java.lang.String getDescription()
        Gets the description of this command.
        Returns:
        The description of this command.
      • getDescriptionLocalizations

        java.util.Map<DiscordLocale,​java.lang.String> getDescriptionLocalizations()
        Gets the description localizations of this command.
        Returns:
        The description localizations of this command.
      • getDefaultRequiredPermissions

        java.util.Optional<java.util.EnumSet<PermissionType>> getDefaultRequiredPermissions()
        Gets the default required permissions for this command. This may differ from the actual permissions of the command if they have been changed by a server administrator.
        Returns:
        The default required permissions for this command.
      • isDisabledByDefault

        boolean isDisabledByDefault()
        Gets whether this command is disabled and only usable by server administrators by default. Note that this is different to getDefaultRequiredPermissions() returning PermissionType.ADMINISTRATOR.
        Returns:
        Whether this command is disabled by default.
      • isEnabledInDms

        boolean isEnabledInDms()
        Gets whether this command can be used in DMs. Will always return false for server commands.
        Returns:
        Whether the command is enabled in DMs
      • getServerId

        java.util.Optional<java.lang.Long> getServerId()
        Gets the server id of this command if it is not global.
        Returns:
        The server of this command.
      • getServer

        java.util.Optional<Server> getServer()
        Gets the server of this command if it is not global.
        Returns:
        The server of this command.
      • isGlobalApplicationCommand

        boolean isGlobalApplicationCommand()
        Gets whether this application command is global.
        Returns:
        If this application command is global or not.
      • isServerApplicationCommand

        boolean isServerApplicationCommand()
        Gets whether this application command is a server application command.
        Returns:
        If this application command is a server application command or not.
      • delete

        java.util.concurrent.CompletableFuture<java.lang.Void> delete()
        Deletes this application command.
        Returns:
        A future to check if the deletion was successful.
      • deleteGlobal

        @Deprecated
        java.util.concurrent.CompletableFuture<java.lang.Void> deleteGlobal()
        Deprecated.
        Use delete() instead.
        Deletes this application command globally.
        Returns:
        A future to check if the deletion was successful.
      • deleteForServer

        @Deprecated
        default java.util.concurrent.CompletableFuture<java.lang.Void> deleteForServer​(Server server)
        Deprecated.
        Use delete() instead.
        Deletes this application command for a server.
        Parameters:
        server - The server where the command should be deleted from.
        Returns:
        A future to check if the deletion was successful.
      • deleteForServer

        @Deprecated
        java.util.concurrent.CompletableFuture<java.lang.Void> deleteForServer​(long server)
        Deprecated.
        Use delete() instead.
        Deletes this application command for a server.
        Parameters:
        server - The server where the command should be deleted from.
        Returns:
        A future to check if the deletion was successful.