Interface DiscordApiBuilderDelegate



  • public interface DiscordApiBuilderDelegate
    This class is internally used by the DiscordApiBuilder to create discord api instances. You usually don't want to interact with this object.
    • Method Detail

      • setProxySelector

        void setProxySelector​(ProxySelector proxySelector)
        Sets the proxy selector which should be used to determine the proxies that should be used to connect to the Discord REST API and websocket.
        Parameters:
        proxySelector - The proxy selector to set.
      • setProxy

        void setProxy​(Proxy proxy)
        Sets the proxy which should be used to connect to the Discord REST API and websocket.
        Parameters:
        proxy - The poxy to set.
      • setProxyAuthenticator

        void setProxyAuthenticator​(Authenticator authenticator)
        Sets the authenticator that should be used to authenticate against proxies that require it.
        Parameters:
        authenticator - The proxy authenticator to set.
      • setTrustAllCertificates

        void setTrustAllCertificates​(boolean trustAllCertificates)
        Sets whether all SSL certificates should be trusted when connecting to the Discord API and websocket.
        Parameters:
        trustAllCertificates - Whether to trust all SSL certificates.
      • setToken

        void setToken​(String token)
        Sets the token.
        Parameters:
        token - The token to set.
      • getToken

        Optional<String> getToken​()
        Gets the token.
        Returns:
        The token.
      • setAccountType

        void setAccountType​(AccountType accountType)
        Sets the account type.
        Parameters:
        accountType - The account type to set.
      • getAccountType

        AccountType getAccountType​()
        Gets the account type.
        Returns:
        The account type.
      • getTotalShards

        int getTotalShards​()
        Gets the total shards.
        Returns:
        The total shards.
      • getCurrentShard

        int getCurrentShard​()
        Sets the current shard.
        Returns:
        The current shard.
      • setWaitForServersOnStartup

        void setWaitForServersOnStartup​(boolean waitForServersOnStartup)
        Sets the wait for servers on startup flag.
        Parameters:
        waitForServersOnStartup - The wait for servers on startup flag to set.
      • isWaitingForServersOnStartup

        boolean isWaitingForServersOnStartup​()
        Checks if Javacord should wait for all servers to become available on startup.
        Returns:
        If Javacord should wait.
      • loginShards

        Collection<CompletableFuture<DiscordApi>> loginShards​(int... shards)
        Login given shards to the account with the given token. It is invalid to call setCurrentShard(int) with anything but 0 before calling this method.
        Parameters:
        shards - The shards to connect, starting with 0!
        Returns:
        A collection of CompletableFutures which contain the DiscordApis for the shards.
      • setRecommendedTotalShards

        CompletableFuture<Void> setRecommendedTotalShards​()
        Sets the recommended total shards.
        Returns:
        A future to check if the action was successful.