Package net.dv8tion.jda.api.events
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 aDataObjectinstance 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
JDABuilderorDefaultShardManagerBuilder.
-
-
Constructor Summary
Constructors Constructor Description RawGatewayEvent(JDA api, long responseNumber, DataObject data)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataObjectgetPackage()The raw gateway package including sequence and type.DataObjectgetPayload()The payload of the package.java.lang.StringgetType()The type of event.-
Methods inherited from class net.dv8tion.jda.api.events.Event
getJDA, getResponseNumber
-
-
-
-
Constructor Detail
-
RawGatewayEvent
public RawGatewayEvent(@Nonnull JDA api, long responseNumber, @Nonnull DataObject data)
-
-
Method Detail
-
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
DataObjectinstance
-
getType
@Nonnull public java.lang.String getType()
The type of event.- Returns:
- The type of event.
-
-