Class ServerBuilder



  • public class ServerBuilder
    extends Object
    This class can be used to create a server.
    • 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.