From 6d816991829a4b34b7674d8a4468976ed204a642 Mon Sep 17 00:00:00 2001 From: "sentry[bot]" <39604003+sentry[bot]@users.noreply.github.com> Date: Tue, 19 May 2026 11:21:46 +0000 Subject: [PATCH] feat: Add missing application fields (event webhooks, flags_new) --- .../Entities/Application/DiscordApplication.cs | 18 ++++++++++++++++++ .../ApplicationEventWebhooksStatus.cs | 17 +++++++++++++++++ .../Transport/TransportApplication.cs | 18 ++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 DisCatSharp/Enums/Application/ApplicationEventWebhooksStatus.cs diff --git a/DisCatSharp/Entities/Application/DiscordApplication.cs b/DisCatSharp/Entities/Application/DiscordApplication.cs index beb17d6e39..4364f7eec3 100644 --- a/DisCatSharp/Entities/Application/DiscordApplication.cs +++ b/DisCatSharp/Entities/Application/DiscordApplication.cs @@ -145,8 +145,26 @@ internal DiscordApplication(TransportApplication tapp) this.MaxParticipants = tapp.MaxParticipants; this.ApprovedConsoles = [.. tapp.ApprovedConsoles]; this.PricingLocalizationStrategy = tapp.PricingLocalizationStrategy; + this.EventWebhooksUrl = tapp.EventWebhooksUrl; + this.EventWebhooksStatus = tapp.EventWebhooksStatus; + this.EventWebhooksTypes = tapp.EventWebhooksTypes?.AsReadOnly() ?? (IReadOnlyList)Array.Empty(); } + /// + /// Gets the url that event webhooks are sent to. + /// + public string? EventWebhooksUrl { get; internal set; } + + /// + /// Gets the status of whether event webhooks are enabled for the application. + /// + public ApplicationEventWebhooksStatus? EventWebhooksStatus { get; internal set; } + + /// + /// Gets the list of event webhook types the application subscribes to. + /// + public IReadOnlyList EventWebhooksTypes { get; internal set; } = Array.Empty(); + /// /// Gets the application's summary. /// diff --git a/DisCatSharp/Enums/Application/ApplicationEventWebhooksStatus.cs b/DisCatSharp/Enums/Application/ApplicationEventWebhooksStatus.cs new file mode 100644 index 0000000000..e05052e425 --- /dev/null +++ b/DisCatSharp/Enums/Application/ApplicationEventWebhooksStatus.cs @@ -0,0 +1,17 @@ +namespace DisCatSharp.Enums; + +/// +/// Represents the status of the application's event webhooks. +/// +public enum ApplicationEventWebhooksStatus +{ + /// + /// Event webhooks are disabled. + /// + Disabled = 1, + + /// + /// Event webhooks are enabled. + /// + Enabled = 2 +} \ No newline at end of file diff --git a/DisCatSharp/Net/Abstractions/Transport/TransportApplication.cs b/DisCatSharp/Net/Abstractions/Transport/TransportApplication.cs index ef8c122131..289863f26b 100644 --- a/DisCatSharp/Net/Abstractions/Transport/TransportApplication.cs +++ b/DisCatSharp/Net/Abstractions/Transport/TransportApplication.cs @@ -354,4 +354,22 @@ internal TransportApplication() /// [JsonProperty("parent_id", NullValueHandling = NullValueHandling.Ignore)] public Optional ParentId { get; set; } + + /// + /// Gets or sets the event webhooks url. + /// + [JsonProperty("event_webhooks_url", NullValueHandling = NullValueHandling.Include)] + public string? EventWebhooksUrl { get; set; } + + /// + /// Gets or sets the event webhooks status. + /// + [JsonProperty("event_webhooks_status", NullValueHandling = NullValueHandling.Ignore)] + public ApplicationEventWebhooksStatus? EventWebhooksStatus { get; set; } + + /// + /// Gets or sets the event webhook types the application subscribes to. + /// + [JsonProperty("event_webhooks_types", NullValueHandling = NullValueHandling.Ignore)] + public List EventWebhooksTypes { get; set; } = []; }