Class RawGatewayEvent

java.lang.Object
net.dv8tion.jda.api.events.Event
net.dv8tion.jda.api.events.RawGatewayEvent
All Implemented Interfaces:
GenericEvent

public class RawGatewayEvent extends Event
Wrapper for the raw dispatch event received from discord.
This provides the raw structure of a gateway event through a DataObject instance containing:
  • d: The payload of the package (DataObject)
  • t: The type of the package (String)
  • op: The opcode of the package, always 0 for dispatch (int)
  • s: The sequence number, equivalent to Event.getResponseNumber() (long)

Sent after derived events. This is disabled by default and can be enabled through either the JDABuilder or DefaultShardManagerBuilder.

See Also:
  • Constructor Details

  • Method Details

    • getPackage

      @Nonnull public DataObject getPackage()
      The raw gateway package including sequence and type.
      • d: The payload of the package (DataObject)
      • t: The type of the package (String)
      • op: The opcode of the package, always 0 for dispatch (int)
      • s: The sequence number, equivalent to Event.getResponseNumber() (long)
      Returns:
      The data object
    • getPayload

      @Nonnull public DataObject getPayload()
      The payload of the package.
      Returns:
      The payload as a DataObject instance
    • getType

      @Nonnull public String getType()
      The type of event.
      Returns:
      The type of event.