Interface ApplicationInfo

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      boolean doesBotRequireCodeGrant()
      Whether the bot requires code grant to invite or not.
      java.lang.String getDescription()
      The description of the bot's application.
      java.lang.String getIconId()
      The icon id of the bot's application.
      java.lang.String getIconUrl()
      The icon-url of the bot's application.
      default java.lang.String getInviteUrl​(long guildId, java.util.Collection<Permission> permissions)
      Creates a OAuth invite-link used to invite the bot.
      default java.lang.String getInviteUrl​(long guildId, Permission... permissions)
      Creates a OAuth invite-link used to invite the bot.
      java.lang.String getInviteUrl​(java.lang.String guildId, java.util.Collection<Permission> permissions)
      Creates a OAuth invite-link used to invite the bot.
      default java.lang.String getInviteUrl​(java.lang.String guildId, Permission... permissions)
      Creates a OAuth invite-link used to invite the bot.
      default java.lang.String getInviteUrl​(java.util.Collection<Permission> permissions)
      Creates a OAuth invite-link used to invite the bot.
      default java.lang.String getInviteUrl​(Permission... permissions)
      Creates a OAuth invite-link used to invite the bot.
      JDA getJDA()
      The JDA instance of this ApplicationInfo (the one logged into this application's bot account).
      java.lang.String getName()
      The name of the bot's application.
      User getOwner()
      The owner of the bot's application.
      boolean isBotPublic()
      Whether the bot is public or not.
    • Method Detail

      • doesBotRequireCodeGrant

        boolean doesBotRequireCodeGrant()
        Whether the bot requires code grant to invite or not.

        This means that additional OAuth2 steps are required to authorize the application to make a bot join a guild like &response_type=code together with a valid &redirect_uri.
        For more information look at the Discord OAuth2 documentation.

        Returns:
        Whether the bot requires code grant
      • getDescription

        java.lang.String getDescription()
        The description of the bot's application.
        Returns:
        The description of the bot's application or an empty String if no description is defined
      • getIconId

        java.lang.String getIconId()
        The icon id of the bot's application.
        The application icon is not necessarily the same as the bot's avatar!
        Returns:
        The icon id of the bot's application or null if no icon is defined
      • getIconUrl

        java.lang.String getIconUrl()
        The icon-url of the bot's application.
        The application icon is not necessarily the same as the bot's avatar!
        Returns:
        The icon-url of the bot's application or null if no icon is defined
      • getInviteUrl

        default java.lang.String getInviteUrl​(java.util.Collection<Permission> permissions)
        Creates a OAuth invite-link used to invite the bot.

        The link is provided in the following format:
        https://discordapp.com/oauth2/authorize?client_id=APPLICATION_ID&scope=bot&permissions=PERMISSIONS
        Unnecessary query parameters are stripped.

        Parameters:
        permissions - Possibly empty Collection of Permissions that should be requested via invite.
        Returns:
        The link used to invite the bot
      • getInviteUrl

        default java.lang.String getInviteUrl​(Permission... permissions)
        Creates a OAuth invite-link used to invite the bot.

        The link is provided in the following format:
        https://discordapp.com/oauth2/authorize?client_id=APPLICATION_ID&scope=bot&permissions=PERMISSIONS
        Unnecessary query parameters are stripped.

        Parameters:
        permissions - Permissions that should be requested via invite.
        Returns:
        The link used to invite the bot
      • getInviteUrl

        java.lang.String getInviteUrl​(java.lang.String guildId,
                                      java.util.Collection<Permission> permissions)
        Creates a OAuth invite-link used to invite the bot.

        The link is provided in the following format:
        https://discordapp.com/oauth2/authorize?client_id=APPLICATION_ID&scope=bot&permissions=PERMISSIONS&guild_id=GUILD_ID
        Unnecessary query parameters are stripped.

        Parameters:
        guildId - The id of the pre-selected guild.
        permissions - Possibly empty Collection of Permissions that should be requested via invite.
        Returns:
        The link used to invite the bot
        Throws:
        java.lang.NumberFormatException - If the provided id cannot be parsed by Long.parseLong(String)
      • getInviteUrl

        default java.lang.String getInviteUrl​(long guildId,
                                              java.util.Collection<Permission> permissions)
        Creates a OAuth invite-link used to invite the bot.

        The link is provided in the following format:
        https://discordapp.com/oauth2/authorize?client_id=APPLICATION_ID&scope=bot&permissions=PERMISSIONS&guild_id=GUILD_ID
        Unnecessary query parameters are stripped.

        Parameters:
        guildId - The id of the pre-selected guild.
        permissions - Possibly empty Collection of Permissions that should be requested via invite.
        Returns:
        The link used to invite the bot
      • getInviteUrl

        default java.lang.String getInviteUrl​(java.lang.String guildId,
                                              Permission... permissions)
        Creates a OAuth invite-link used to invite the bot.

        The link is provided in the following format:
        https://discordapp.com/oauth2/authorize?client_id=APPLICATION_ID&scope=bot&permissions=PERMISSIONS&guild_id=GUILD_ID
        Unnecessary query parameters are stripped.

        Parameters:
        guildId - The id of the pre-selected guild.
        permissions - Possibly empty array of Permissions that should be requested via invite.
        Returns:
        The link used to invite the bot
        Throws:
        java.lang.NumberFormatException - If the provided id cannot be parsed by Long.parseLong(String)
      • getInviteUrl

        default java.lang.String getInviteUrl​(long guildId,
                                              Permission... permissions)
        Creates a OAuth invite-link used to invite the bot.

        The link is provided in the following format:
        https://discordapp.com/oauth2/authorize?client_id=APPLICATION_ID&scope=bot&permissions=PERMISSIONS&guild_id=GUILD_ID
        Unnecessary query parameters are stripped.

        Parameters:
        guildId - The id of the pre-selected guild.
        permissions - Possibly empty array of Permissions that should be requested via invite.
        Returns:
        The link used to invite the bot
      • getJDA

        JDA getJDA()
        The JDA instance of this ApplicationInfo (the one logged into this application's bot account).
        Returns:
        The JDA instance of this ApplicationInfo
      • getName

        java.lang.String getName()
        The name of the bot's application.
        The application name is not necessarily the same as the bot's name!
        Returns:
        The name of the bot's application.
      • getOwner

        User getOwner()
        The owner of the bot's application. This may be a fake user.
        Returns:
        The owner of the bot's application
      • isBotPublic

        boolean isBotPublic()
        Whether the bot is public or not. Public bots can be added by anyone. When false only the owner can invite the bot to guilds.
        Returns:
        Whether the bot is public