Package discord4j.core.object.presence
Class ClientPresence
- java.lang.Object
-
- discord4j.core.object.presence.ClientPresence
-
public class ClientPresence extends Object
Presence data that can be sent to Discord.This is as opposed to
Presence
which is received from Discord.Each static factory corresponds to a
Status
with an optionalClientActivity
.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ClientPresence
doNotDisturb()
Creates ado not disturb
presence.static ClientPresence
doNotDisturb(ClientActivity activity)
Creates ado not disturb
presence.discord4j.discordjson.json.gateway.StatusUpdate
getStatusUpdate()
Converts this presence's data to an object for use by the gateway.static ClientPresence
idle()
Creates anidle
presence.static ClientPresence
idle(ClientActivity activity)
Creates anidle
presence.static ClientPresence
invisible()
Creates anStatus.INVISIBLE
presence.static ClientPresence
of(Status status, ClientActivity activity)
Creates a presence with the given status and activity.static ClientPresence
online()
Creates anonline
presence.static ClientPresence
online(ClientActivity activity)
Creates anonline
presence.
-
-
-
Method Detail
-
online
public static ClientPresence online()
Creates anonline
presence.- Returns:
- An online presence.
-
online
public static ClientPresence online(ClientActivity activity)
Creates anonline
presence.- Parameters:
activity
- The activity to be shown.- Returns:
- An online presence with the given activity.
-
doNotDisturb
public static ClientPresence doNotDisturb()
Creates ado not disturb
presence.- Returns:
- A do not disturb presence.
-
doNotDisturb
public static ClientPresence doNotDisturb(ClientActivity activity)
Creates ado not disturb
presence.- Parameters:
activity
- The activity to be shown.- Returns:
- A do not disturb with the given activity.
-
idle
public static ClientPresence idle()
Creates anidle
presence.- Returns:
- An idle presence.
-
idle
public static ClientPresence idle(ClientActivity activity)
Creates anidle
presence.- Parameters:
activity
- The activity to be shown.- Returns:
- An idle presence with the given activity.
-
invisible
public static ClientPresence invisible()
Creates anStatus.INVISIBLE
presence.- Returns:
- An invisible presence.
-
of
public static ClientPresence of(Status status, @Nullable ClientActivity activity)
Creates a presence with the given status and activity.- Parameters:
status
- The status to be shown.activity
- The activity to be shown.- Returns:
- A presence with the given status and activity.
-
getStatusUpdate
public discord4j.discordjson.json.gateway.StatusUpdate getStatusUpdate()
Converts this presence's data to an object for use by the gateway.- Returns:
- An equivalent
StatusUpdate
for this presence.
-
-