Class ApplicationManager


  • public class ApplicationManager
    extends net.dv8tion.jda.core.managers.impl.ManagerBase
    Manager providing functionality to update one or more fields for an Application.

    Example

    
     manager.setName("Yui")
            .setDescription("Simple but outdated bot")
            .queue();
     manager.reset(ApplicationManager.NAME | ApplicationManager.PUBLIC)
            .setName("BooBot")
            .setDescription("Even more outdated bot")
            .queue();
     
    Since:
    3.0
    Author:
    Aljoscha Grebe
    See Also:
    Application.getManager()
    • Field Detail

      • DESCRIPTION

        public static final long DESCRIPTION
        Used to reset the description field
        See Also:
        Constant Field Values
      • REDIRECT_URI

        public static final long REDIRECT_URI
        Used to reset the redirect uri field
        See Also:
        Constant Field Values
      • CODE_GRANT

        public static final long CODE_GRANT
        Used to reset the code grant field
        See Also:
        Constant Field Values
    • Constructor Detail

      • ApplicationManager

        public ApplicationManager​(net.dv8tion.jda.client.entities.impl.ApplicationImpl application)
    • Method Detail

      • reset

        @CheckReturnValue
        public ApplicationManager reset​(long fields)
        Resets the fields specified by the provided bit-flag pattern. You can specify a combination by using a bitwise OR concat of the flag constants.
        Example: manager.reset(ApplicationManager.NAME | ApplicationManager.ROLES);

        Flag Constants:

        Overrides:
        reset in class net.dv8tion.jda.core.managers.impl.ManagerBase
        Parameters:
        fields - Integer value containing the flags to reset.
        Returns:
        ApplicationManager for chaining convenience
      • reset

        @CheckReturnValue
        public ApplicationManager reset​(long... fields)
        Resets the fields specified by the provided bit-flag patterns. You can specify a combination by using a bitwise OR concat of the flag constants.
        Example: manager.reset(ApplicationManager.NAME, ApplicationManager.ICON);

        Flag Constants:

        Overrides:
        reset in class net.dv8tion.jda.core.managers.impl.ManagerBase
        Parameters:
        fields - Integer values containing the flags to reset.
        Returns:
        ApplicationManager for chaining convenience
      • reset

        @CheckReturnValue
        public ApplicationManager reset()
        Resets all fields for this manager.
        Returns:
        ApplicationManager for chaining convenience
      • setDescription

        @CheckReturnValue
        public ApplicationManager setDescription​(java.lang.String description)
        Sets the description of the selected Application.

        A description must not be longer than 400 characters long!

        Parameters:
        description - The new description for the selected Application or null to reset
        Returns:
        ApplicationManager for chaining convenience
        Throws:
        java.lang.IllegalArgumentException - If the provided description is more than 400 characters long
      • setDoesBotRequireCodeGrant

        @CheckReturnValue
        public ApplicationManager setDoesBotRequireCodeGrant​(boolean requireCodeGrant)
        Sets the code grant state of the selected Application's bot.
        Parameters:
        requireCodeGrant - The new state for the selected Application's bot
        Returns:
        ApplicationManager for chaining convenience
      • setIcon

        @CheckReturnValue
        public ApplicationManager setIcon​(Icon icon)
        Sets the icon of the selected Application.
        Parameters:
        icon - The new Icon for the selected Application or null to reset
        Returns:
        ApplicationManager for chaining convenience
      • setIsBotPublic

        @CheckReturnValue
        public ApplicationManager setIsBotPublic​(boolean botPublic)
        Sets the public state of the selected Application's bot.
        Parameters:
        botPublic - The new state for the selected Application's bot
        Returns:
        ApplicationManager for chaining convenience
      • setName

        @CheckReturnValue
        public ApplicationManager setName​(java.lang.String name)
        Sets the name of the selected Application.

        A name must not be null nor less than 2 characters or more than 32 characters long!

        Parameters:
        name - The new name for the selected Application
        Returns:
        ApplicationManager for chaining convenience
        Throws:
        java.lang.IllegalArgumentException - If the provided name is null, less than 2 or more than 32 characters long
      • setRedirectUris

        @CheckReturnValue
        public ApplicationManager setRedirectUris​(java.util.List<java.lang.String> redirectUris)
        Sets the redirect uris of the selected Application.

        The redirect uris must not be null!

        Parameters:
        redirectUris - The new redirect uris for the selected Application or null to reset
        Returns:
        ApplicationManager for chaining convenience
        Throws:
        java.lang.IllegalArgumentException - If one of the uris is null