Class MemberUpdateEvent
- java.lang.Object
-
- discord4j.core.event.domain.Event
-
- discord4j.core.event.domain.guild.GuildEvent
-
- discord4j.core.event.domain.guild.MemberUpdateEvent
-
public class MemberUpdateEvent extends GuildEvent
Dispatched when a user's nickname or roles change in a guild.This event is dispatched by Discord.
- See Also:
- Guild Member Update
-
-
Constructor Summary
Constructors Constructor Description MemberUpdateEvent(GatewayDiscordClient gateway, ShardInfo shardInfo, long guildId, long memberId, Member old, Set<Long> currentRoleIds, String currentNickname, String currentJoinedAt, String currentPremiumSince, Boolean currentPending)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<String>getCurrentNickname()Gets the current nickname of theMemberinvolved in this event, if present.Optional<Instant>getCurrentPremiumSince()Gets when the user started boosting the guild, if present.Set<Snowflake>getCurrentRoleIds()Flux<Role>getCurrentRoles()Mono<Guild>getGuild()Requests to retrieve theGuildinvolved in the event.SnowflakegetGuildId()Optional<Instant>getJoinTime()Gets the current join time of theMemberinvolved in this event, if present.Mono<Member>getMember()Requests to retrieve theMemberinvolved in the event.SnowflakegetMemberId()Optional<Member>getOld()Gets the old version of theMemberinvolved in the event, if present.booleanisCurrentPending()Gets whether the user has currently not yet passed the guild's Membership Screening requirements.StringtoString()-
Methods inherited from class discord4j.core.event.domain.Event
getClient, getShardInfo
-
-
-
-
Constructor Detail
-
MemberUpdateEvent
public MemberUpdateEvent(GatewayDiscordClient gateway, ShardInfo shardInfo, long guildId, long memberId, @Nullable Member old, Set<Long> currentRoleIds, @Nullable String currentNickname, @Nullable String currentJoinedAt, @Nullable String currentPremiumSince, @Nullable Boolean currentPending)
-
-
Method Detail
-
getOld
public Optional<Member> getOld()
Gets the old version of theMemberinvolved in the event, if present. This may not be available ifMembersare not stored.- Returns:
- the old version of the
Memberinvolved, if present.
-
getCurrentRoleIds
public Set<Snowflake> getCurrentRoleIds()
- Returns:
- The IDs of the roles the
Memberis assigned.
-
getCurrentNickname
public Optional<String> getCurrentNickname()
Gets the current nickname of theMemberinvolved in this event, if present.- Returns:
- The current nickname, if any, of the
Memberinvolved, if present.
-
getJoinTime
public Optional<Instant> getJoinTime()
Gets the current join time of theMemberinvolved in this event, if present. It is typically absent if this event is caused by a lurking stage channel member.- Returns:
- The current join time of the
Memberinvolved in this event, if present.
-
getCurrentPremiumSince
public Optional<Instant> getCurrentPremiumSince()
Gets when the user started boosting the guild, if present.- Returns:
- When the user started boosting the guild, if present.
-
isCurrentPending
public boolean isCurrentPending()
Gets whether the user has currently not yet passed the guild's Membership Screening requirements.- Returns:
- Whether the user has currently not yet passed the guild's Membership Screening requirements.
-
-