Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions DisCatSharp/Entities/Application/DiscordApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>)Array.Empty<string>();
}

/// <summary>
/// Gets the url that event webhooks are sent to.
/// </summary>
public string? EventWebhooksUrl { get; internal set; }

/// <summary>
/// Gets the status of whether event webhooks are enabled for the application.
/// </summary>
public ApplicationEventWebhooksStatus? EventWebhooksStatus { get; internal set; }

/// <summary>
/// Gets the list of event webhook types the application subscribes to.
/// </summary>
public IReadOnlyList<string> EventWebhooksTypes { get; internal set; } = Array.Empty<string>();

/// <summary>
/// Gets the application's summary.
/// </summary>
Expand Down
17 changes: 17 additions & 0 deletions DisCatSharp/Enums/Application/ApplicationEventWebhooksStatus.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace DisCatSharp.Enums;

/// <summary>
/// Represents the status of the application's event webhooks.
/// </summary>
public enum ApplicationEventWebhooksStatus
{
/// <summary>
/// Event webhooks are disabled.
/// </summary>
Disabled = 1,

/// <summary>
/// Event webhooks are enabled.
/// </summary>
Enabled = 2
}
18 changes: 18 additions & 0 deletions DisCatSharp/Net/Abstractions/Transport/TransportApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -354,4 +354,22 @@ internal TransportApplication()
/// </summary>
[JsonProperty("parent_id", NullValueHandling = NullValueHandling.Ignore)]
public Optional<ulong?> ParentId { get; set; }

/// <summary>
/// Gets or sets the event webhooks url.
/// </summary>
[JsonProperty("event_webhooks_url", NullValueHandling = NullValueHandling.Include)]
public string? EventWebhooksUrl { get; set; }

/// <summary>
/// Gets or sets the event webhooks status.
/// </summary>
[JsonProperty("event_webhooks_status", NullValueHandling = NullValueHandling.Ignore)]
public ApplicationEventWebhooksStatus? EventWebhooksStatus { get; set; }

/// <summary>
/// Gets or sets the event webhook types the application subscribes to.
/// </summary>
[JsonProperty("event_webhooks_types", NullValueHandling = NullValueHandling.Ignore)]
public List<string> EventWebhooksTypes { get; set; } = [];
}
Loading