-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add role subscription system channel flags and message field (discord…
- Loading branch information
Showing
5 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace NetCord.JsonModels; | ||
|
||
public class JsonRoleSubscriptionData | ||
{ | ||
[JsonPropertyName("role_subscription_listing_id")] | ||
public ulong RoleSubscriptionListingId { get; set; } | ||
|
||
[JsonPropertyName("tier_name")] | ||
public string TierName { get; set; } | ||
|
||
[JsonPropertyName("total_months_subscribed")] | ||
public int TotalMonthsSubscribed { get; set; } | ||
|
||
[JsonPropertyName("is_renewal")] | ||
public bool IsRenewal { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
namespace NetCord.Rest; | ||
|
||
public class RoleSubscriptionData : IJsonModel<JsonModels.JsonRoleSubscriptionData> | ||
{ | ||
JsonModels.JsonRoleSubscriptionData IJsonModel<JsonModels.JsonRoleSubscriptionData>.JsonModel => _jsonModel; | ||
private readonly JsonModels.JsonRoleSubscriptionData _jsonModel; | ||
|
||
public RoleSubscriptionData(JsonModels.JsonRoleSubscriptionData jsonModel) | ||
{ | ||
_jsonModel = jsonModel; | ||
} | ||
|
||
/// <summary> | ||
/// The id of the sku and listing that the user is subscribed to. | ||
/// </summary> | ||
public ulong RoleSubscriptionListingId => _jsonModel.RoleSubscriptionListingId; | ||
|
||
/// <summary> | ||
/// The name of the tier that the user is subscribed to. | ||
/// </summary> | ||
public string TierName => _jsonModel.TierName; | ||
|
||
/// <summary> | ||
/// The cumulative number of months that the user has been subscribed for. | ||
/// </summary> | ||
public int TotalMonthsSubscribed => _jsonModel.TotalMonthsSubscribed; | ||
|
||
/// <summary> | ||
/// Whether this notification is for a renewal rather than a new purchase. | ||
/// </summary> | ||
public bool IsRenewal => _jsonModel.IsRenewal; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters