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
Activity
which is received from Discord.An activity is combined with a
Status
to create aClientPresence
.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ClientActivity
competing(String name)
Creates acompeting
activity.discord4j.discordjson.json.ActivityUpdateRequest
getActivityUpdateRequest()
Converts this activity's data to an object for use by the gateway.static ClientActivity
listening(String name)
Creates alistening
activity.static ClientActivity
of(Activity.Type type, String name, String url)
Creates an activity with the given type, name, and url.static ClientActivity
playing(String name)
Creates aplaying
activity.static ClientActivity
streaming(String name, String url)
Creates astreaming
activity.static ClientActivity
watching(String name)
Creates awatching
activity.
-
-
-
Method Detail
-
playing
public static ClientActivity playing(String name)
Creates aplaying
activity.- 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 astreaming
activity.- 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 alistening
activity.- Parameters:
name
- The name of the activity.- Returns:
- A listening activity with the given name.
-
watching
public static ClientActivity watching(String name)
Creates awatching
activity.- Parameters:
name
- The name of the activity.- Returns:
- A watching activity with the given name.
-
competing
public static ClientActivity competing(String name)
Creates acompeting
activity.- 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 forstreaming
activities).- 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
ActivityUpdateRequest
for this activity.
-
-