Class DiscordWebhookEventEnvelope
- Namespace
- DisCatSharp.Hosting.AspNetCore.Ingress.WebhookEvents
- Assembly
- DisCatSharp.Hosting.AspNetCore.dll
Represents a parsed inbound Discord webhook event envelope.
public sealed class DiscordWebhookEventEnvelope
- Inheritance
-
DiscordWebhookEventEnvelope
- Inherited Members
Constructors
- DiscordWebhookEventEnvelope(int, DiscordIngressPayload, JsonElement, int?, string?, string?, string?, JsonElement?, JsonElement?)
Initializes a new instance of the DiscordWebhookEventEnvelope class.
Properties
- ApplicationId
Gets the application identifier when present on the payload.
- Data
Gets the raw nested event data object when present on the payload.
- Event
Gets the raw nested event object when present on the payload.
- EventType
Gets the event type when present on the payload.
- HasData
Gets a value indicating whether the payload included nested event data.
- HasEvent
Gets a value indicating whether the payload included a nested event object.
- IsEvent
Gets a value indicating whether the envelope represents a Discord webhook event.
- IsPing
Gets a value indicating whether the envelope represents a Discord webhook ping.
- Payload
Gets the raw request payload.
- Root
Gets the parsed JSON root object.
- SuggestedDataModelType
Gets the recommended CLR model for the current EventType, when known.
- Timestamp
Gets the parsed event timestamp when present on the payload.
- TimestampRaw
Gets the raw event timestamp when present on the payload.
- Type
Gets the webhook envelope type discriminator.
- Version
Gets the webhook envelope version when present on the payload.
Methods
- DeserializeData<T>()
Deserializes the nested event data into a typed model.
- TryDeserializeData<T>(out T?)
Attempts to deserialize the nested event data into a typed model.
- TryGetDataProperty(string, out JsonElement)
Attempts to resolve a property from the nested event data object.
- TryGetEventProperty(string, out JsonElement)
Attempts to resolve a property from the nested event object.
- TryGetProperty(string, out JsonElement)
Attempts to resolve a top-level property from the envelope.