Class ActivityContext

java.lang.Object
com.dianxin.tori.api.utils.quicksetup.ActivityContext

public final class ActivityContext extends Object
A utility class for parsing and constructing JDA Activity instances from raw strings.
  • 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 corresponding Activity object.

      If the rawType is invalid, it defaults to Activity.ActivityType.PLAYING. If the type is STREAMING but the URL is missing or blank, it also falls back to PLAYING.

      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 is STREAMING.
      Returns:
      The constructed Activity, or null if the rawType is null.