[Feature] Add purchase notification (#2942)
This commit is contained in:
@@ -81,6 +81,9 @@ namespace Discord.WebSocket
|
||||
/// <inheritdoc />
|
||||
public MessageRoleSubscriptionData RoleSubscriptionData { get; private set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public PurchaseNotification PurchaseNotification { get; private set; }
|
||||
|
||||
/// <inheritdoc cref="IMessage.Thread"/>
|
||||
public SocketThreadChannel Thread { get; private set; }
|
||||
|
||||
@@ -303,6 +306,14 @@ namespace Discord.WebSocket
|
||||
Thread = guild?.AddOrUpdateChannel(state, model.Thread.Value) as SocketThreadChannel;
|
||||
}
|
||||
|
||||
if (model.PurchaseNotification.IsSpecified)
|
||||
{
|
||||
PurchaseNotification = new PurchaseNotification(model.PurchaseNotification.Value.Type,
|
||||
model.PurchaseNotification.Value.ProductPurchase.IsSpecified
|
||||
? new GuildProductPurchase(model.PurchaseNotification.Value.ProductPurchase.Value.ListingId, model.PurchaseNotification.Value.ProductPurchase.Value.ProductName)
|
||||
: null);
|
||||
}
|
||||
|
||||
if (model.Call.IsSpecified)
|
||||
CallData = new MessageCallData(model.Call.Value.Participants, model.Call.Value.EndedTimestamp.ToNullable());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user