Class ActivityImpl
java.lang.Object
net.dv8tion.jda.internal.entities.ActivityImpl
- All Implemented Interfaces:
Activity
- Direct Known Subclasses:
RichPresenceImpl
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.dv8tion.jda.api.entities.Activity
Activity.ActivityType, Activity.Timestamps
-
Field Summary
Fields inherited from interface net.dv8tion.jda.api.entities.Activity
MAX_ACTIVITY_NAME_LENGTH, MAX_ACTIVITY_STATE_LENGTH, STREAMING_URL
-
Method Summary
Modifier and TypeMethodDescriptionRichPresence
representation of this Activity.boolean
getEmoji()
The emoji (or custom emoji) attached to a custom status.getName()
The displayed name of theActivity
.getState()
The user's activity state
Example: "Looking to Play", "Playing Solo", "In a Group"Information on the match duration, start, and end.getType()
The type ofActivity
.getUrl()
The URL of theActivity
if the game is actually a Stream.int
hashCode()
boolean
isRich()
toString()
Adds the provided state to the activity.
-
Method Details
-
isRich
public boolean isRich()Description copied from interface:Activity
- Specified by:
isRich
in interfaceActivity
- Returns:
true
if this is aRichPresence
-
asRichPresence
Description copied from interface:Activity
RichPresence
representation of this Activity.- Specified by:
asRichPresence
in interfaceActivity
- Returns:
- RichPresence or
null
ifActivity.isRich()
returnsfalse
-
getName
Description copied from interface:Activity
The displayed name of theActivity
.
ForActivity.ActivityType.CUSTOM_STATUS
this will return the custom status text. -
getState
Description copied from interface:Activity
The user's activity state
Example: "Looking to Play", "Playing Solo", "In a Group"This shows below the normal activity information in the profile.
Example
Code:
Display:Activity.playing("Trivia") .withState("Question 20")
Playing Trivia Question 20
-
getUrl
Description copied from interface:Activity
The URL of theActivity
if the game is actually a Stream.
This will return null for regular games. -
getType
Description copied from interface:Activity
The type ofActivity
.- Specified by:
getType
in interfaceActivity
- Returns:
- Never-null
ActivityType
representing the type of Activity
-
getTimestamps
Description copied from interface:Activity
Information on the match duration, start, and end.- Specified by:
getTimestamps
in interfaceActivity
- Returns:
Timestamps
wrapper ofnull
if unset
-
getEmoji
Description copied from interface:Activity
The emoji (or custom emoji) attached to a custom status. -
withState
Description copied from interface:Activity
Adds the provided state to the activity.
The state is shown below the activity, unless it is acustom status
. -
equals
-
hashCode
public int hashCode() -
toString
-