GatewayMessage

@Serializable
data class GatewayMessage(val opCode: OpCode, val dataPayload: JsonElement?, val sequenceNumber: Int? = null, val event: String? = null)(source)

A message sent through the websocket gateway.

Constructors

Link copied to clipboard
constructor(opCode: OpCode, dataPayload: JsonElement?, sequenceNumber: Int? = null, event: String? = null)

Properties

Link copied to clipboard
@SerialName(value = "d")
val dataPayload: JsonElement?

The JSON payload, if one is present.

Link copied to clipboard
@SerialName(value = "t")
val event: String? = null

the event name, only for OpCode.DISPATCH.

Link copied to clipboard
@SerialName(value = "op")
val opCode: OpCode

The code representing the type of message.

Link copied to clipboard
@SerialName(value = "s")
val sequenceNumber: Int? = null

The message sequence, used for tracking order of messages.