Enum GatewayOpcode

    • Enum Constant Detail

      • DISPATCH

        public static final GatewayOpcode DISPATCH
        Dispatches an event.
      • HEARTBEAT

        public static final GatewayOpcode HEARTBEAT
        Used for ping checking.
      • IDENTIFY

        public static final GatewayOpcode IDENTIFY
        Used for client handshake.
      • STATUS_UPDATE

        public static final GatewayOpcode STATUS_UPDATE
        Used to update the client status.
      • VOICE_STATE_UPDATE

        public static final GatewayOpcode VOICE_STATE_UPDATE
        Used to join/move/leave voice channels.
      • VOICE_SERVER_PING

        public static final GatewayOpcode VOICE_SERVER_PING
        Used for voice ping checking.
      • RESUME

        public static final GatewayOpcode RESUME
        Used to resume a closed connection.
      • RECONNECT

        public static final GatewayOpcode RECONNECT
        Used to tell clients to reconnect to the gateway.
      • REQUEST_GUILD_MEMBERS

        public static final GatewayOpcode REQUEST_GUILD_MEMBERS
        Used to request guild members.
      • INVALID_SESSION

        public static final GatewayOpcode INVALID_SESSION
        Used to notify client they have an invalid session id.
      • HELLO

        public static final GatewayOpcode HELLO
        Sent immediately after connecting, contains heartbeat and server debug information.
      • HEARTBEAT_ACK

        public static final GatewayOpcode HEARTBEAT_ACK
        Sent immediately following a client heartbeat that was received.
    • Method Detail

      • values

        public static GatewayOpcode[] 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 (GatewayOpcode c : GatewayOpcode.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static GatewayOpcode 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
      • fromCode

        public static Optional<GatewayOpcode> fromCode​(int code)
        Gets the gateway opcode by actual numeric code.
        Parameters:
        code - The actual numeric code.
        Returns:
        The gateway opcode with the actual numeric code.
      • getCode

        public int getCode​()
        Gets the actual numeric code.
        Returns:
        The actual numeric code.