Package discord4j.core.event.domain
Class InviteCreateEvent
- java.lang.Object
-
- discord4j.core.event.domain.Event
-
- discord4j.core.event.domain.InviteCreateEvent
-
public class InviteCreateEvent extends Event
Dispatched when a new invite to a channel is created.This event is dispatched by Discord.
- See Also:
- Invite Create
-
-
Constructor Summary
Constructors Constructor Description InviteCreateEvent(GatewayDiscordClient client, ShardInfo shardInfo, Long guildId, long channelId, String code, User inviter, Instant createdAt, int uses, int maxUses, int maxAge, boolean temporary)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Snowflake
getChannelId()
Gets theSnowflake
ID of the channel the invite is for.String
getCode()
Gets the invite code (unique ID).Instant
getCreation()
Gets when this invite was created.Optional<Instant>
getExpiration()
Gets the instant this invite expires, if possible.Mono<Guild>
getGuild()
Requests to retrieve theGuild
that had an invite created in this event.Optional<Snowflake>
getGuildId()
Mono<Invite>
getInvite()
Requests to retrieve the invite Created.Optional<User>
getInviter()
Gets the user that created the invite, if present.int
getMaxAge()
Gets how long the invite is valid for (in seconds).int
getMaxUses()
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
isTemporary()
Gets whether or not the invite is temporary (invited users will be kicked on disconnect unless they're assigned a role).String
toString()
-
Methods inherited from class discord4j.core.event.domain.Event
getClient, getShardInfo
-
-
-
-
Method Detail
-
getGuildId
public Optional<Snowflake> getGuildId()
- Returns:
- The ID of the guild involved, if present.
-
getGuild
public Mono<Guild> getGuild()
Requests to retrieve theGuild
that had an invite created in this event.
-
getChannelId
public Snowflake getChannelId()
Gets theSnowflake
ID of the channel the invite is for.- Returns:
- The ID of the channel involved.
-
getCode
public String getCode()
Gets the invite code (unique ID).- Returns:
- The invite code (unique ID).
-
getInviter
public Optional<User> 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 or not the invite is temporary (invited users will be kicked on disconnect unless they're assigned a role).- Returns:
- Whether or not the invite is temporary.
-
getCreation
public Instant getCreation()
Gets when this invite was created.- Returns:
- When this invite was created.
-
getExpiration
public Optional<Instant> getExpiration()
Gets the instant this invite expires, if possible.- Returns:
- The instant this invite expires, if possible.
-
-