Package discord4j.core.object.presence
Class ClientActivity
- java.lang.Object
-
- discord4j.core.object.presence.ClientActivity
-
public class ClientActivity extends Object
Activity data that can be sent to Discord.This is as opposed to
Activitywhich is received from Discord.An activity is combined with a
Statusto create aClientPresence.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ClientActivitycompeting(String name)Creates acompetingactivity.discord4j.discordjson.json.ActivityUpdateRequestgetActivityUpdateRequest()Converts this activity's data to an object for use by the gateway.static ClientActivitylistening(String name)Creates alisteningactivity.static ClientActivityof(Activity.Type type, String name, String url)Creates an activity with the given type, name, and url.static ClientActivityplaying(String name)Creates aplayingactivity.static ClientActivitystreaming(String name, String url)Creates astreamingactivity.static ClientActivitywatching(String name)Creates awatchingactivity.
-
-
-
Method Detail
-
playing
public static ClientActivity playing(String name)
Creates aplayingactivity.- Parameters:
name- The name of the activity.- Returns:
- A playing activity with the given name.
-
streaming
public static ClientActivity streaming(String name, String url)
Creates astreamingactivity.- Parameters:
name- The name of the activity.url- The stream url.- Returns:
- A streaming activity with the given name and url.
-
listening
public static ClientActivity listening(String name)
Creates alisteningactivity.- Parameters:
name- The name of the activity.- Returns:
- A listening activity with the given name.
-
watching
public static ClientActivity watching(String name)
Creates awatchingactivity.- Parameters:
name- The name of the activity.- Returns:
- A watching activity with the given name.
-
competing
public static ClientActivity competing(String name)
Creates acompetingactivity.- Parameters:
name- The name of the activity.- Returns:
- A competing activity with the given name.
-
of
public static ClientActivity of(Activity.Type type, String name, @Nullable String url)
Creates an activity with the given type, name, and url.- Parameters:
type- The type of the activity.name- The name of the activity.url- The url of the activity (only valid forstreamingactivities).- Returns:
- An activity with the given type, name, and url.
-
getActivityUpdateRequest
public discord4j.discordjson.json.ActivityUpdateRequest getActivityUpdateRequest()
Converts this activity's data to an object for use by the gateway.- Returns:
- An equivalent
ActivityUpdateRequestfor this activity.
-
-