Package org.javacord.api.internal
Interface DiscordApiBuilderDelegate
-
public interface DiscordApiBuilderDelegateThis class is internally used by theDiscordApiBuilderto create discord api instances. You usually don't want to interact with this object.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetCurrentShard()Sets the current shard.intgetTotalShards()Gets the total shards.CompletableFuture<DiscordApi>login()Logs the bot in.Collection<CompletableFuture<DiscordApi>>loginShards(int... shards)Login given shards to the account with the given token.voidsetAccountType(AccountType accountType)Sets the account type.voidsetCurrentShard(int currentShard)Sets the current shards.CompletableFuture<Void>setRecommendedTotalShards()Sets the recommended total shards.voidsetToken(String token)Sets the token.voidsetTotalShards(int totalShards)Sets the total shards.voidsetWaitForServersOnStartup(boolean waitForServersOnStartup)Sets the wait for servers on startup flag.
-
-
-
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.
-
setTotalShards
void setTotalShards(int totalShards)
Sets the total shards.- Parameters:
totalShards- The total shards to set.- See Also:
DiscordApiBuilder.setTotalShards(int)
-
setCurrentShard
void setCurrentShard(int currentShard)
Sets the current shards.- Parameters:
currentShard- The current shards to set.- See Also:
DiscordApiBuilder.setCurrentShard(int)
-
setWaitForServersOnStartup
void setWaitForServersOnStartup(boolean waitForServersOnStartup)
Sets the wait for servers on startup flag.- Parameters:
waitForServersOnStartup- The wait for servers on startup flag to set.
-
login
CompletableFuture<DiscordApi> login()
Logs the bot in.- Returns:
- The discord api instance.
-
loginShards
Collection<CompletableFuture<DiscordApi>> loginShards(int... shards)
Login given shards to the account with the given token. It is invalid to callsetCurrentShard(int)with anything but0before calling this method.- Parameters:
shards- The shards to connect, starting with0!- Returns:
- A collection of
CompletableFutures which contain theDiscordApis 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.
-
-