Package discord4j.core.object.presence
Class Presence
java.lang.Object
discord4j.core.object.presence.Presence
Presence is the current state of a user on a guild, received from Discord.
This is as opposed to ClientPresence
which is sent to Discord.
A presence includes a user's activities
and their current status
on a given
platform
.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the user's current activities.Get a user's current activity, if present.Get the user's status.getStatus
(Status.Platform platform) Get the user's status for the given platform, if present.toString()
-
Constructor Details
-
Presence
public Presence(discord4j.discordjson.json.PresenceData data)
-
-
Method Details
-
getStatus
Get the user's status.- Returns:
- The user's status.
-
getStatus
Get the user's status for the given platform, if present.- Parameters:
platform
- the platform to obtain a user status- Returns:
- an
Optional
with the user's status for a given platform, or empty if not present.
-
getActivity
Get a user's current activity, if present.- Returns:
- an
Optional
with the user's activity, or empty if not present.
-
getActivities
Get the user's current activities.- Returns:
- The user's current activities.
-
toString
-