Class Activity


  • public class Activity
    extends Object
    • Method Detail

      • getData

        public discord4j.discordjson.json.ActivityData getData()
        Gets the data of the activity.
        Returns:
        The data of the activity.
      • getType

        public Activity.Type getType()
        Gets the type for this activity.
        Returns:
        The type for this activity.
      • getName

        public String getName()
        Gets the activity's name.
        Returns:
        The activity's name.
      • getStreamingUrl

        public Optional<String> getStreamingUrl()
        Gets the stream URL, if present.
        Returns:
        The stream url, if present.
      • getCreatedAt

        public Instant getCreatedAt()
        Gets unix timestamp of when the activity was added to the user's session.
        Returns:
        The unix timestamp of when the activity was added to the user's session.
      • getStart

        public Optional<Instant> getStart()
        Gets the UNIX time (in milliseconds) of when the activity started, if present.
        Returns:
        The UNIX time (in milliseconds) of when the activity started, if present.
      • getEnd

        public Optional<Instant> getEnd()
        Gets the UNIX time (in milliseconds) of when the activity ends, if present.
        Returns:
        The UNIX time (in milliseconds) of when the activity ends, if present.
      • getApplicationId

        public Optional<Snowflake> getApplicationId()
        Gets the application ID for the game, if present.
        Returns:
        The application ID for the game, if present.
      • getDetails

        public Optional<String> getDetails()
        Gets what the player is currently doing, if present.
        Returns:
        What the player is currently doing, if present.
      • getState

        public Optional<String> getState()
        Gets the user's current party status, if present.
        Returns:
        The user's current party status, if present.
      • getPartyId

        public Optional<String> getPartyId()
        Gets the ID of the party, if present.
        Returns:
        The ID of the party, if present.
      • getCurrentPartySize

        public OptionalLong getCurrentPartySize()
        Gets the party's current size, if present.
        Returns:
        The party's current size, if present.
      • getMaxPartySize

        public OptionalLong getMaxPartySize()
        Gets the party's max size, if present.
        Returns:
        The party's max size, if present.
      • getLargeImageId

        public Optional<String> getLargeImageId()
        Gets the ID for a large asset of the activity, usually a Snowflake, if present.
        Returns:
        The ID for a large asset of the activity, usually a Snowflake, if present.
      • getLargeText

        public Optional<String> getLargeText()
        Gets the text displayed when hovering over the large image of the activity, if present.
        Returns:
        The text displayed when hovering over the large image of the activity, if present.
      • getSmallImageId

        public Optional<String> getSmallImageId()
        Gets the ID for a small asset of the activity, usually a Snowflake, if present.
        Returns:
        The ID for a small asset of the activity, usually a Snowflake, if present.
      • getSmallText

        public Optional<String> getSmallText()
        Gets the text displayed when hovering over the small image of the activity, if present.
        Returns:
        The text displayed when hovering over the small image of the activity, if present.
      • getJoinSecret

        public Optional<String> getJoinSecret()
        Gets the secret for joining a party, if present.
        Returns:
        The secret for joining a party, if present.
      • getSpectateSecret

        public Optional<String> getSpectateSecret()
        Gets the secret for spectating a game, if present.
        Returns:
        The secret for spectating a game, if present.
      • getMatchSecret

        public Optional<String> getMatchSecret()
        Gets the secret for a specific instanced match, if present.
        Returns:
        The secret for a specific instanced match, if present.
      • getEmoji

        public Optional<ReactionEmoji> getEmoji()
        Gets the emoji used for a custom status, if present.
        Returns:
        The emoji used for a custom status, if present.
      • isInstance

        public boolean isInstance()
        Gets whether or not the activity is an instanced game session.
        Returns:
        Whether or not the activity is an instanced game session.