Class InviteBuilder
- java.lang.Object
-
- org.javacord.api.entity.server.invite.InviteBuilder
-
public class InviteBuilder extends java.lang.ObjectA class to createinviteobjects.
-
-
Constructor Summary
Constructors Constructor Description InviteBuilder(ServerChannel channel)Creates a new invite builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<Invite>create()Creates the invite.InviteBuildersetAuditLogReason(java.lang.String reason)Sets the reason for the creation.InviteBuildersetMaxAgeInSeconds(int maxAge)Sets the duration of the invite in seconds before expiry, or 0 for never.InviteBuildersetMaxUses(int maxUses)Sets the max number of uses or 0 for unlimited.InviteBuildersetNeverExpire()Sets the invite to never expire.InviteBuildersetTemporary(boolean temporary)Sets whether this invite should only grant temporary membership or not.InviteBuildersetUnique(boolean unique)Sets whether this invite should be unique or not.
-
-
-
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(java.lang.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.
-
create
public java.util.concurrent.CompletableFuture<Invite> create()
Creates the invite.- Returns:
- The created invite.
-
-