Class InviteBuilder



  • public class InviteBuilder
    extends Object
    A class to create invite objects.
    • Constructor Detail

      • InviteBuilder

        public InviteBuilder​(ServerChannel channel)
        Creates a new invite builder.
        Parameters:
        channel - The channel for the invite.
    • Method Detail

      • setAuditLogReason

        public InviteBuilder setAuditLogReason​(String reason)
        Sets the reason for the creation. This reason will be visible in the audit log entry(s).
        Parameters:
        reason - The reason for this update.
        Returns:
        The current instance in order to chain call methods.
      • setMaxAgeInSeconds

        public InviteBuilder setMaxAgeInSeconds​(int maxAge)
        Sets the duration of the invite in seconds before expiry, or 0 for never. The default value is 86400 (24 hours).
        Parameters:
        maxAge - The duration of the invite in seconds before expiry, or 0 for never.
        Returns:
        The current instance in order to chain call methods.
      • setNeverExpire

        public InviteBuilder setNeverExpire​()
        Sets the invite to never expire. This is the same as setting the max age to 0.
        Returns:
        The current instance in order to chain call methods.
        See Also:
        setMaxAgeInSeconds(int)
      • setMaxUses

        public InviteBuilder setMaxUses​(int maxUses)
        Sets the max number of uses or 0 for unlimited. The default value is 0 (unlimited uses).
        Parameters:
        maxUses - The max number of uses or 0 for unlimited.
        Returns:
        The current instance in order to chain call methods.
      • setTemporary

        public InviteBuilder setTemporary​(boolean temporary)
        Sets whether this invite should only grant temporary membership or not. The default value is false.
        Parameters:
        temporary - Whether this invite should only grant temporary membership or not.
        Returns:
        The current instance in order to chain call methods.
      • setUnique

        public InviteBuilder setUnique​(boolean unique)
        Sets whether this invite should be unique or not. The default value is false.
        Parameters:
        unique - Whether this invite should be unique or not.
        Returns:
        The current instance in order to chain call methods.