[Feature] Add purchase notification (#2942)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
12
src/Discord.Net.Core/Entities/Messages/PurchaseType.cs
Normal file
12
src/Discord.Net.Core/Entities/Messages/PurchaseType.cs
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user