Class BotInviteBuilder


  • public class BotInviteBuilder
    extends java.lang.Object
    A tool to create bot invites.
    • Field Detail

      • BASE_LINK

        public static final java.lang.String BASE_LINK
        The base link for a bot application invite link.
        See Also:
        Constant Field Values
    • Constructor Detail

      • BotInviteBuilder

        public BotInviteBuilder​(long clientId)
        Creates a new bot invite builder.
        Parameters:
        clientId - The client id of the bot's application.
      • BotInviteBuilder

        public BotInviteBuilder​(java.lang.String clientId)
        Creates a new bot invite builder.
        Parameters:
        clientId - The client id of the bot's application.
      • BotInviteBuilder

        public BotInviteBuilder​(DiscordApi api)
        Creates a new bot invite builder.
        Parameters:
        api - The Discord API to use.
    • Method Detail

      • setPermissions

        public BotInviteBuilder setPermissions​(Permissions permissions)
        Sets the permissions the bot should have.
        Parameters:
        permissions - The permissions to set.
        Returns:
        The current instance in order to chain call methods.
      • setPermissions

        public BotInviteBuilder setPermissions​(PermissionType... permissions)
        Sets the permissions the bot should have.
        Parameters:
        permissions - The permissions to set.
        Returns:
        The current instance in order to chain call methods.
      • setRedirectUri

        public BotInviteBuilder setRedirectUri​(java.lang.String redirectUri)
        Sets the redirect uri for this invite builder.
        Parameters:
        redirectUri - The redirect uri to set.
        Returns:
        The current instance in order to chain call methods.
      • setScopes

        public BotInviteBuilder setScopes​(java.util.Collection<BotInviteScope> scopes)
        Sets the scopes for this invite builder.
        Parameters:
        scopes - The scopes to set.
        Returns:
        The current instance in order to chain call methods.
      • setScopes

        public BotInviteBuilder setScopes​(BotInviteScope... scopes)
        Sets the scopes for this invite builder.
        Parameters:
        scopes - The scopes to set.
        Returns:
        The current instance in order to chain call methods.
      • addScopes

        public BotInviteBuilder addScopes​(java.util.Collection<BotInviteScope> scopes)
        Adds the scopes for this invite builder.
        Parameters:
        scopes - The scopes to add.
        Returns:
        The current instance in order to chain call methods.
      • addScopes

        public BotInviteBuilder addScopes​(BotInviteScope... scopes)
        Adds the scopes for this invite builder.
        Parameters:
        scopes - The scopes to add.
        Returns:
        The current instance in order to chain call methods.
      • setPromptConsent

        public BotInviteBuilder setPromptConsent​(boolean promptConsent)
        Sets whether to append prompt consent to the invite link.
        Parameters:
        promptConsent - Whether to append prompt consent or not.
        Returns:
        The current instance in order to chain call methods.
      • build

        public java.lang.String build()
        Creates the invite link.
        Returns:
        The invite link for the bot.