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 AccountTypegetAccountType()Gets the account type.intgetCurrentShard()Sets the current shard.Optional<String>getToken()Gets the token.intgetTotalShards()Gets the total shards.booleanisWaitingForServersOnStartup()Checks if Javacord should wait for all servers to become available on startup.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.voidsetProxy(Proxy proxy)Sets the proxy which should be used to connect to the Discord REST API and websocket.voidsetProxyAuthenticator(Authenticator authenticator)Sets the authenticator that should be used to authenticate against proxies that require it.voidsetProxySelector(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.CompletableFuture<Void>setRecommendedTotalShards()Sets the recommended total shards.voidsetToken(String token)Sets the token.voidsetTotalShards(int totalShards)Sets the total shards.voidsetTrustAllCertificates(boolean trustAllCertificates)Sets whether all SSL certificates should be trusted when connecting to the Discord API and websocket.voidsetWaitForServersOnStartup(boolean waitForServersOnStartup)Sets the wait for servers on startup flag.
-
-
-
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.
-
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.
-
setTotalShards
void setTotalShards(int totalShards)
Sets the total shards.- Parameters:
totalShards- The total shards to set.- See Also:
DiscordApiBuilder.setTotalShards(int)
-
getTotalShards
int getTotalShards()
Gets the total shards.- Returns:
- The total shards.
-
setCurrentShard
void setCurrentShard(int currentShard)
Sets the current shards.- Parameters:
currentShard- The current shards to set.- See Also:
DiscordApiBuilder.setCurrentShard(int)
-
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.
-
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.
-
-