Enum Game.GameType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Game.GameType>
    Enclosing class:
    Game

    public static enum Game.GameType
    extends java.lang.Enum<Game.GameType>
    The type game being played, differentiating between a game and stream types.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      DEFAULT
      The GameType used to represent a normal Game status.
      LISTENING
      Used to indicate that the Game should display as Listening... in the official client.
      STREAMING
      Used to indicate that the Game is a stream
      This type is displayed as "Streaming" in the discord client.
      WATCHING
      Used to indicate that the Game should display as Watching... in the official client.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static Game.GameType fromKey​(int key)
      Gets the GameType related to the provided key.
      int getKey()
      The Discord defined id key for this GameType.
      static Game.GameType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static Game.GameType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • DEFAULT

        public static final Game.GameType DEFAULT
        The GameType used to represent a normal Game status.
      • STREAMING

        public static final Game.GameType STREAMING
        Used to indicate that the Game is a stream
        This type is displayed as "Streaming" in the discord client.
      • LISTENING

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

        @Incubating
        public static final Game.GameType WATCHING
        Used to indicate that the Game should display as Watching... in the official client.
        Incubating:
        This feature is not yet confirmed for the official bot API
    • Method Detail

      • values

        public static Game.GameType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Game.GameType c : Game.GameType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Game.GameType valueOf​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getKey

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

        public static Game.GameType fromKey​(int key)
        Gets the GameType related to the provided key.
        If an unknown key is provided, this returns DEFAULT
        Parameters:
        key - The Discord key referencing a GameType.
        Returns:
        The GameType that has the key provided, or DEFAULT for unknown key.