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 optional ClientActivity.

See Also:
  • Method Details

    • online

      public static ClientPresence online()
      Creates an online presence.
      Returns:
      An online presence.
    • online

      public static ClientPresence online(ClientActivity activity)
      Creates an online presence.
      Parameters:
      activity - The activity to be shown.
      Returns:
      An online presence with the given activity.
    • doNotDisturb

      public static ClientPresence doNotDisturb()
      Creates a do not disturb presence.
      Returns:
      A do not disturb presence.
    • doNotDisturb

      public static ClientPresence doNotDisturb(ClientActivity activity)
      Creates a do 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 an idle presence.
      Returns:
      An idle presence.
    • idle

      public static ClientPresence idle(ClientActivity activity)
      Creates an idle presence.
      Parameters:
      activity - The activity to be shown.
      Returns:
      An idle presence with the given activity.
    • invisible

      public static ClientPresence invisible()
      Creates an Status.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.