[Feature] Add new message types & error codes (#2562)
* Add new message types & error codes * add role subscription system channel flags and message property
This commit is contained in:
@@ -62,5 +62,7 @@ namespace Discord.API
|
||||
public Optional<MessageInteraction> Interaction { get; set; }
|
||||
[JsonProperty("sticker_items")]
|
||||
public Optional<StickerItem[]> StickerItems { get; set; }
|
||||
[JsonProperty("role_subscription_data")]
|
||||
public Optional<MessageRoleSubscriptionData> RoleSubscriptionData { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API;
|
||||
|
||||
internal class MessageRoleSubscriptionData
|
||||
{
|
||||
[JsonProperty("role_subscription_listing_id")]
|
||||
public ulong SubscriptionListingId { get; set; }
|
||||
|
||||
[JsonProperty("tier_name")]
|
||||
public string TierName { get; set; }
|
||||
|
||||
[JsonProperty("total_months_subscribed")]
|
||||
public int MonthsSubscribed { get; set; }
|
||||
|
||||
[JsonProperty("is_renewal")]
|
||||
public bool IsRenewal { get; set; }
|
||||
}
|
||||
@@ -80,6 +80,9 @@ namespace Discord.Rest
|
||||
/// <inheritdoc/>
|
||||
public MessageType Type { get; private set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public MessageRoleSubscriptionData RoleSubscriptionData { get; private set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IReadOnlyCollection<ActionRowComponent> Components { get; private set; }
|
||||
/// <summary>
|
||||
@@ -243,6 +246,15 @@ namespace Discord.Rest
|
||||
_userMentions = newMentions.ToImmutable();
|
||||
}
|
||||
}
|
||||
|
||||
if (model.RoleSubscriptionData.IsSpecified)
|
||||
{
|
||||
RoleSubscriptionData = new(
|
||||
model.RoleSubscriptionData.Value.SubscriptionListingId,
|
||||
model.RoleSubscriptionData.Value.TierName,
|
||||
model.RoleSubscriptionData.Value.MonthsSubscribed,
|
||||
model.RoleSubscriptionData.Value.IsRenewal);
|
||||
}
|
||||
}
|
||||
/// <inheritdoc />
|
||||
public async Task UpdateAsync(RequestOptions options = null)
|
||||
|
||||
Reference in New Issue
Block a user