Class ActivityContext
java.lang.Object
com.dianxin.tori.api.utils.quicksetup.ActivityContext
A utility class for parsing and constructing JDA
Activity instances from raw strings.-
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable net.dv8tion.jda.api.entities.ActivityparseActivity(@Nullable String rawType, @NotNull String context, @Nullable String url) Parses the provided parameters to construct a correspondingActivityobject.
-
Method Details
-
parseActivity
@Nullable public static @Nullable net.dv8tion.jda.api.entities.Activity parseActivity(@Nullable @Nullable String rawType, @NotNull @NotNull String context, @Nullable @Nullable String url) Parses the provided parameters to construct a correspondingActivityobject.If the
rawTypeis invalid, it defaults toActivity.ActivityType.PLAYING. If the type isSTREAMINGbut the URL is missing or blank, it also falls back toPLAYING.- Parameters:
rawType- The string representation of the ActivityType (e.g., "PLAYING", "WATCHING").context- The main text/context of the activity.url- The URL for the activity, required only if the type isSTREAMING.- Returns:
- The constructed
Activity, ornullif therawTypeis null.
-