using Maki.Gateway;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace Maki.Structures.Gateway
{
///
/// Discord Gateway Payload structure
///
internal struct GatewayPayload
{
///
/// opcode for the payload
///
[JsonProperty("op")]
public GatewayOPCode OPCode;
///
/// event data, can be an object or an integer
///
[JsonProperty("d")]
public object Data;
public T DataAs() => (Data as JObject).ToObject();
///
/// sequence number, used for resuming sessions and heartbeats
///
[JsonProperty("s")]
public int? Sequence;
///
/// the event name for this payload
///
[JsonProperty("t")]
public string Name;
}
}