Package org.javacord.api.entity.server
Class ServerBuilder
- java.lang.Object
-
- org.javacord.api.entity.server.ServerBuilder
-
public class ServerBuilder extends Object
This class can be used to create a server.
-
-
Constructor Summary
Constructors Constructor Description ServerBuilder(DiscordApi api)Creates a new server builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletableFuture<Long>create()Creates the server.ServerBuildersetAfkTimeoutInSeconds(int afkTimeout)Sets the server's afk timeout in seconds.ServerBuildersetDefaultMessageNotificationLevel(DefaultMessageNotificationLevel defaultMessageNotificationLevel)Sets the server's default message notification level.ServerBuildersetExplicitContentFilterLevel(ExplicitContentFilterLevel explicitContentFilterLevel)Sets the server's explicit content filter level.ServerBuildersetIcon(byte[] icon)Sets the server's icon.ServerBuildersetIcon(byte[] icon, String fileType)Sets the server's icon.ServerBuildersetIcon(BufferedImage icon)Sets the server's icon.ServerBuildersetIcon(BufferedImage icon, String fileType)Sets the server's icon.ServerBuildersetIcon(File icon)Sets the server's icon.ServerBuildersetIcon(InputStream icon)Sets the server's icon.ServerBuildersetIcon(InputStream icon, String fileType)Sets the server's icon.ServerBuildersetIcon(URL icon)Sets the server's icon.ServerBuildersetIcon(Icon icon)Sets the server's icon.ServerBuildersetName(String name)Sets the server's name.ServerBuildersetRegion(Region region)Sets the server's region.ServerBuildersetVerificationLevel(VerificationLevel verificationLevel)Sets the server's verification level.
-
-
-
Constructor Detail
-
ServerBuilder
public ServerBuilder(DiscordApi api)
Creates a new server builder.- Parameters:
api- The discord api instance.
-
-
Method Detail
-
setName
public ServerBuilder setName(String name)
Sets the server's name.- Parameters:
name- The name of the server.- Returns:
- The current instance in order to chain call methods.
-
setRegion
public ServerBuilder setRegion(Region region)
Sets the server's region.- Parameters:
region- The region of the server.- Returns:
- The current instance in order to chain call methods.
-
setExplicitContentFilterLevel
public ServerBuilder setExplicitContentFilterLevel(ExplicitContentFilterLevel explicitContentFilterLevel)
Sets the server's explicit content filter level.- Parameters:
explicitContentFilterLevel- The explicit content filter level of the server.- Returns:
- The current instance in order to chain call methods.
-
setVerificationLevel
public ServerBuilder setVerificationLevel(VerificationLevel verificationLevel)
Sets the server's verification level.- Parameters:
verificationLevel- The verification level of the server.- Returns:
- The current instance in order to chain call methods.
-
setDefaultMessageNotificationLevel
public ServerBuilder setDefaultMessageNotificationLevel(DefaultMessageNotificationLevel defaultMessageNotificationLevel)
Sets the server's default message notification level.- Parameters:
defaultMessageNotificationLevel- The default message notification level of the server.- Returns:
- The current instance in order to chain call methods.
-
setAfkTimeoutInSeconds
public ServerBuilder setAfkTimeoutInSeconds(int afkTimeout)
Sets the server's afk timeout in seconds.- Parameters:
afkTimeout- The afk timeout in seconds of the server.- Returns:
- The current instance in order to chain call methods.
-
setIcon
public ServerBuilder setIcon(BufferedImage icon)
Sets the server's icon. This method assumes the file type is "png"!- Parameters:
icon- The icon of the server.- Returns:
- The current instance in order to chain call methods.
-
setIcon
public ServerBuilder setIcon(BufferedImage icon, String fileType)
Sets the server's icon.- Parameters:
icon- The icon of the server.fileType- The type of the icon, e.g. "png" or "jpg".- Returns:
- The current instance in order to chain call methods.
-
setIcon
public ServerBuilder setIcon(File icon)
Sets the server's icon.- Parameters:
icon- The icon of the server.- Returns:
- The current instance in order to chain call methods.
-
setIcon
public ServerBuilder setIcon(Icon icon)
Sets the server's icon.- Parameters:
icon- The icon of the server.- Returns:
- The current instance in order to chain call methods.
-
setIcon
public ServerBuilder setIcon(URL icon)
Sets the server's icon.- Parameters:
icon- The icon of the server.- Returns:
- The current instance in order to chain call methods.
-
setIcon
public ServerBuilder setIcon(byte[] icon)
Sets the server's icon. This method assumes the file type is "png"!- Parameters:
icon- The icon of the server.- Returns:
- The current instance in order to chain call methods.
-
setIcon
public ServerBuilder setIcon(byte[] icon, String fileType)
Sets the server's icon.- Parameters:
icon- The icon of the server.fileType- The type of the icon, e.g. "png" or "jpg".- Returns:
- The current instance in order to chain call methods.
-
setIcon
public ServerBuilder setIcon(InputStream icon)
Sets the server's icon. This method assumes the file type is "png"!- Parameters:
icon- The icon of the server.- Returns:
- The current instance in order to chain call methods.
-
setIcon
public ServerBuilder setIcon(InputStream icon, String fileType)
Sets the server's icon.- Parameters:
icon- The icon of the server.fileType- The type of the icon, e.g. "png" or "jpg".- Returns:
- The current instance in order to chain call methods.
-
create
public CompletableFuture<Long> create()
Creates the server.- Returns:
- The id of the server.
-
-