Package discord4j.core.event.domain
Class InviteCreateEvent
java.lang.Object
discord4j.core.event.domain.Event
discord4j.core.event.domain.InviteCreateEvent
Dispatched when a new invite to a channel is created.
This event is dispatched by Discord.
- See Also:
-
Constructor Summary
ConstructorDescriptionInviteCreateEvent
(GatewayDiscordClient client, ShardInfo shardInfo, Long guildId, long channelId, String code, User inviter, Instant createdAt, int uses, int maxUses, int maxAge, boolean temporary) -
Method Summary
Modifier and TypeMethodDescriptionGets theSnowflake
ID of the channel the invite is for.getCode()
Gets the invite code (unique ID).Gets when this invite was created.Gets the instant this invite expires, if possible.getGuild()
Requests to retrieve theGuild
that had an invite created in this event.Requests to retrieve the invite Created.Gets the user that created the invite, if present.int
Gets how long the invite is valid for (in seconds).int
Gets the max number of times this invite can be used.int
getUses()
Gets the number of times this invite has been used (always will be 0).boolean
Gets whether this invite only grants temporary membership.toString()
Methods inherited from class discord4j.core.event.domain.Event
getClient, getShardInfo
-
Constructor Details
-
InviteCreateEvent
-
-
Method Details
-
getGuildId
- Returns:
- The ID of the guild involved, if present.
-
getGuild
Requests to retrieve theGuild
that had an invite created in this event. -
getChannelId
Gets theSnowflake
ID of the channel the invite is for.- Returns:
- The ID of the channel involved.
-
getCode
Gets the invite code (unique ID).- Returns:
- The invite code (unique ID).
-
getInviter
Gets the user that created the invite, if present.- Returns:
- The user that created the invite, if present.
-
getUses
public int getUses()Gets the number of times this invite has been used (always will be 0).- Returns:
- The number of times this invite has been used (always will be 0).
-
getMaxUses
public int getMaxUses()Gets the max number of times this invite can be used.- Returns:
- The max number of times this invite can be used.
-
getMaxAge
public int getMaxAge()Gets how long the invite is valid for (in seconds).- Returns:
- How long the invite is valid for (in seconds).
-
isTemporary
public boolean isTemporary()Gets whether this invite only grants temporary membership.- Returns:
true
if this invite only grants temporary membership
-
getCreation
Gets when this invite was created.- Returns:
- When this invite was created.
-
getExpiration
Gets the instant this invite expires, if possible.- Returns:
- The instant this invite expires, if possible.
-
getInvite
Requests to retrieve the invite Created. -
toString
-