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

      • setToken

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

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

        void setWaitForServersOnStartup​(boolean waitForServersOnStartup)
        Sets the wait for servers on startup flag.
        Parameters:
        waitForServersOnStartup - The wait for servers on startup flag to set.
      • 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.
      • getTotalShards

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

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