Package discord4j.core.object.presence
Class Activity
- java.lang.Object
-
- discord4j.core.object.presence.Activity
-
public class Activity extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classActivity.Flagstatic classActivity.TypeThe type of "action" for an activity.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<Snowflake>getApplicationId()Gets the application ID for the game, if present.InstantgetCreatedAt()Gets unix timestamp of when the activity was added to the user's session.OptionalLonggetCurrentPartySize()Gets the party's current size, if present.discord4j.discordjson.json.ActivityDatagetData()Gets the data of the activity.Optional<String>getDetails()Gets what the player is currently doing, if present.Optional<ReactionEmoji>getEmoji()Gets the emoji used for a custom status, if present.Optional<Instant>getEnd()Gets the UNIX time (in milliseconds) of when the activity ends, if present.EnumSet<Activity.Flag>getFlags()Optional<String>getJoinSecret()Gets the secret for joining a party, if present.Optional<String>getLargeImageId()Gets the ID for a large asset of the activity, usually aSnowflake, if present.Optional<String>getLargeText()Gets the text displayed when hovering over the large image of the activity, if present.Optional<String>getMatchSecret()Gets the secret for a specific instanced match, if present.OptionalLonggetMaxPartySize()Gets the party's max size, if present.StringgetName()Gets the activity's name.Optional<String>getPartyId()Gets the ID of the party, if present.Optional<String>getSmallImageId()Gets the ID for a small asset of the activity, usually aSnowflake, if present.Optional<String>getSmallText()Gets the text displayed when hovering over the small image of the activity, if present.Optional<String>getSpectateSecret()Gets the secret for spectating a game, if present.Optional<Instant>getStart()Gets the UNIX time (in milliseconds) of when the activity started, if present.Optional<String>getState()Gets the user's current party status, if present.Optional<String>getStreamingUrl()Gets the stream URL, if present.Activity.TypegetType()Gets the type for this activity.booleanisInstance()Gets whether or not the activity is an instanced game session.StringtoString()
-
-
-
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 aSnowflake, 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 aSnowflake, 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.
-
getFlags
public EnumSet<Activity.Flag> getFlags()
-
-