Enum Activity.ActivityType

java.lang.Object
java.lang.Enum<Activity.ActivityType>
net.dv8tion.jda.api.entities.Activity.ActivityType
All Implemented Interfaces:
Serializable, Comparable<Activity.ActivityType>
Enclosing interface:
Activity

public static enum Activity.ActivityType extends Enum<Activity.ActivityType>
The activity being executed, differentiating between, amongst others, playing, listening and streaming.
  • Enum Constant Details

    • PLAYING

      public static final Activity.ActivityType PLAYING
      Used to indicate that the Activity should display as Playing... in the official client.
    • STREAMING

      public static final Activity.ActivityType STREAMING
      Used to indicate that the Activity is a stream and should be displayed as Streaming... in the official client.
    • LISTENING

      public static final Activity.ActivityType LISTENING
      Used to indicate that the Activity should display as Listening... in the official client.
    • WATCHING

      public static final Activity.ActivityType WATCHING
      Used to indicate that the Activity should display as Watching... in the official client.
    • CUSTOM_STATUS

      public static final Activity.ActivityType CUSTOM_STATUS
      Used to indicate that the Activity should display as a custom status in the official client.
    • COMPETING

      public static final Activity.ActivityType COMPETING
      Used to indicate that the Activity should display as Competing in... in the official client.
      Since:
      4.2.1
  • Method Details

    • values

      public static Activity.ActivityType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static Activity.ActivityType valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getKey

      public int getKey()
      The Discord defined id key for this ActivityType.
      Returns:
      the id key.
    • fromKey

      @Nonnull public static Activity.ActivityType fromKey(int key)
      Gets the ActivityType related to the provided key.
      If an unknown key is provided, this returns PLAYING
      Parameters:
      key - The Discord key referencing a ActivityType.
      Returns:
      The ActivityType that has the key provided, or PLAYING for unknown key.