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
Presencewhich is received from Discord.Each static factory corresponds to a
Statuswith an optionalClientActivity.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ClientPresencedoNotDisturb()Creates ado not disturbpresence.static ClientPresencedoNotDisturb(ClientActivity activity)Creates ado not disturbpresence.discord4j.discordjson.json.gateway.StatusUpdategetStatusUpdate()Converts this presence's data to an object for use by the gateway.static ClientPresenceidle()Creates anidlepresence.static ClientPresenceidle(ClientActivity activity)Creates anidlepresence.static ClientPresenceinvisible()Creates anStatus.INVISIBLEpresence.static ClientPresenceof(Status status, ClientActivity activity)Creates a presence with the given status and activity.static ClientPresenceonline()Creates anonlinepresence.static ClientPresenceonline(ClientActivity activity)Creates anonlinepresence.
-
-
-
Method Detail
-
online
public static ClientPresence online()
Creates anonlinepresence.- Returns:
- An online presence.
-
online
public static ClientPresence online(ClientActivity activity)
Creates anonlinepresence.- Parameters:
activity- The activity to be shown.- Returns:
- An online presence with the given activity.
-
doNotDisturb
public static ClientPresence doNotDisturb()
Creates ado not disturbpresence.- Returns:
- A do not disturb presence.
-
doNotDisturb
public static ClientPresence doNotDisturb(ClientActivity activity)
Creates ado not disturbpresence.- Parameters:
activity- The activity to be shown.- Returns:
- A do not disturb with the given activity.
-
idle
public static ClientPresence idle()
Creates anidlepresence.- Returns:
- An idle presence.
-
idle
public static ClientPresence idle(ClientActivity activity)
Creates anidlepresence.- Parameters:
activity- The activity to be shown.- Returns:
- An idle presence with the given activity.
-
invisible
public static ClientPresence invisible()
Creates anStatus.INVISIBLEpresence.- 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
StatusUpdatefor this presence.
-
-