Package discord4j.core.event.domain
Class PresenceUpdateEvent
java.lang.Object
discord4j.core.event.domain.Event
discord4j.core.event.domain.PresenceUpdateEvent
Dispatched when a user's presence changes. This includes username, discriminator, and avatar changes.
The old presence may not be present if presences are not stored.
This event is dispatched by Discord.
- See Also:
-
Constructor Summary
ConstructorDescriptionPresenceUpdateEvent
(GatewayDiscordClient gateway, ShardInfo shardInfo, long guildId, User oldUser, discord4j.discordjson.json.PartialUserData user, Presence current, Presence old) -
Method Summary
Modifier and TypeMethodDescriptionGets the current, new version of thePresence
.getGuild()
Gets theUser
's new avatar, if present.Deprecated.This method will be removed once the system change is complete.Gets theUser
's new global name, if present.Gets theUser
's new username, if present.getOld()
Gets the old version of thePresence
that was changed, if present.Gets the old version of theUser
that was updated, if present.getUser()
Requests to retrieve theUser
whose presence has been changed in this event.toString()
Methods inherited from class discord4j.core.event.domain.Event
getClient, getShardInfo
-
Constructor Details
-
PresenceUpdateEvent
-
-
Method Details
-
getGuildId
- Returns:
- The ID of the
Guild
involved.
-
getGuild
-
getOldUser
Gets the old version of theUser
that was updated, if present. This may not be available ifUsers
are not stored.- Returns:
- The old version of the
User
, if present.
-
getNewGlobalName
Gets theUser
's new global name, if present. This may not exist if theuser
's global name has not been changed.- Returns:
- The
User
's new global name, if present.
-
getNewUsername
Gets theUser
's new username, if present. This may not exist if theuser
's username has not been changed.- Returns:
- The
User
's new username, if present.
-
getNewDiscriminator
Deprecated.This method will be removed once the system change is complete.Gets theUser
's new discriminator, if present. This may not exist if theUser
's discriminator has not been changed.- Returns:
- The
User
's new discriminator, if present.
-
getNewAvatar
Gets theUser
's new avatar, if present. This may not exist if theUser
's discriminator has not been changed.- Returns:
- The user's new avatar, if present.
-
getUserId
- Returns:
- The ID of the
User
whose presence has been updated.
-
getUser
Requests to retrieve theUser
whose presence has been changed in this event. -
getMember
-
getCurrent
Gets the current, new version of thePresence
.- Returns:
- The current, new version of the
Presence
.
-
getOld
Gets the old version of thePresence
that was changed, if present. This may not be available ifPresence
are not stored.- Returns:
- The old version of the
Presence
, if present.
-
toString
-