public class InviteCreateSpec extends Object implements AuditSpec<discord4j.discordjson.json.InviteCreateRequest>
Invite
objects.Constructor and Description |
---|
InviteCreateSpec() |
Modifier and Type | Method and Description |
---|---|
discord4j.discordjson.json.InviteCreateRequest |
asRequest() |
String |
getReason()
Returns the current audit log reason set on the spec.
|
InviteCreateSpec |
setMaxAge(int maxAge)
Sets the duration of the created
Invite in seconds before expiration, or 0 to never expire. |
InviteCreateSpec |
setMaxUses(int maxUses)
Sets the maximum number of uses the created
Invite has before expiring, or 0 for unlimited
uses. |
InviteCreateSpec |
setReason(String reason)
Sets the reason to show in the audit logs when the spec is built.
|
InviteCreateSpec |
setTemporary(boolean temporary)
Sets whether the created
Invite only grants temporary membership. |
InviteCreateSpec |
setUnique(boolean unique)
Sets whether the created
Invite is unique. |
public InviteCreateSpec setMaxAge(int maxAge)
Invite
in seconds before expiration, or 0
to never expire. If
unset, the default of 24 hours will be used.maxAge
- The duration of the invite in seconds, or 0
to never expire.public InviteCreateSpec setMaxUses(int maxUses)
Invite
has before expiring, or 0
for unlimited
uses. If unset, the default is unlimited usages.maxUses
- The maximum number of uses, or 0
for unlimited usage.public InviteCreateSpec setTemporary(boolean temporary)
Invite
only grants temporary membership. This property is false
by
default.temporary
- true
if this invite is temporary, false
otherwise.public InviteCreateSpec setUnique(boolean unique)
Invite
is unique. If true
, don't try to reuse a similar invite
(useful for creating many unique one time use invites).unique
- true
if the created invite is unique, false
otherwise.public InviteCreateSpec setReason(@Nullable String reason)
AuditSpec
@Nullable public String getReason()
AuditSpec