[Feature] Add purchase notification (#2942)

This commit is contained in:
Mihail Gribkov
2024-06-16 20:33:40 +03:00
committed by GitHub
parent 21195a8a93
commit 9d92435493
9 changed files with 113 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
namespace Discord;
/// <summary>
/// Represents a guild product purchase.
/// </summary>
public readonly struct GuildProductPurchase
{
/// <summary>
/// Gets the ID of the listing.
/// </summary>
public readonly ulong ListingId;
/// <summary>
/// Gets the name of the product.
/// </summary>
public readonly string ProductName;
internal GuildProductPurchase(ulong listingId, string productName)
{
ListingId = listingId;
ProductName = productName;
}
}

View File

@@ -226,6 +226,11 @@ namespace Discord
/// </returns>
MessageRoleSubscriptionData RoleSubscriptionData { get; }
/// <summary>
/// Gets the purchase notification for this message.
/// </summary>
PurchaseNotification PurchaseNotification { get; }
/// <summary>
/// Gets the call data of the message.
/// </summary>

View File

@@ -0,0 +1,23 @@
namespace Discord;
/// <summary>
/// Represents a purchase notification.
/// </summary>
public readonly struct PurchaseNotification
{
/// <summary>
/// Gets the type of the purchase.
/// </summary>
public readonly PurchaseType Type;
/// <summary>
/// Gets the purchased product.
/// </summary>
public readonly GuildProductPurchase? ProductPurchase;
internal PurchaseNotification(PurchaseType type, GuildProductPurchase? productPurchase)
{
Type = type;
ProductPurchase = productPurchase;
}
}

View File

@@ -0,0 +1,12 @@
namespace Discord;
/// <summary>
/// Represents the type of purchase notification.
/// </summary>
public enum PurchaseType
{
/// <summary>
/// A guild product purchase.
/// </summary>
GuildProduct = 0
}