diff --git a/src/Discord.Net.Core/Entities/Guilds/SystemChannelMessageDeny.cs b/src/Discord.Net.Core/Entities/Guilds/SystemChannelMessageDeny.cs
index 06de7b812..d50d680bf 100644
--- a/src/Discord.Net.Core/Entities/Guilds/SystemChannelMessageDeny.cs
+++ b/src/Discord.Net.Core/Entities/Guilds/SystemChannelMessageDeny.cs
@@ -13,18 +13,28 @@ namespace Discord
///
/// Deny the messages that are sent when a user joins the guild.
///
- WelcomeMessage = 0b1,
+ WelcomeMessage = 1 << 0,
///
/// Deny the messages that are sent when a user boosts the guild.
///
- GuildBoost = 0b10,
+ GuildBoost = 1 << 1,
///
/// Deny the messages that are related to guild setup.
///
- GuildSetupTip = 0b100,
+ GuildSetupTip = 1 << 2,
///
/// Deny the reply with sticker button on welcome messages.
///
- WelcomeMessageReply = 0b1000
+ WelcomeMessageReply = 1 << 3,
+
+ ///
+ /// Deny role subscription purchase and renewal notifications in the guild.
+ ///
+ RoleSubscriptionPurchase = 1 << 4,
+
+ ///
+ /// Hide role subscription sticker reply buttons in the guild.
+ ///
+ RoleSubscriptionPurchaseReplies = 1 << 5,
}
}
diff --git a/src/Discord.Net.Core/Entities/Messages/IMessage.cs b/src/Discord.Net.Core/Entities/Messages/IMessage.cs
index 48db4fdf0..0437cd7d1 100644
--- a/src/Discord.Net.Core/Entities/Messages/IMessage.cs
+++ b/src/Discord.Net.Core/Entities/Messages/IMessage.cs
@@ -209,6 +209,14 @@ namespace Discord
///
IMessageInteraction Interaction { get; }
+ ///
+ /// Gets the data of the role subscription purchase or renewal that prompted this message.
+ ///
+ ///
+ /// A if the message is a role subscription purchase message; otherwise .
+ ///
+ MessageRoleSubscriptionData RoleSubscriptionData { get; }
+
///
/// Adds a reaction to this message.
///
diff --git a/src/Discord.Net.Core/Entities/Messages/MessageRoleSubscriptionData.cs b/src/Discord.Net.Core/Entities/Messages/MessageRoleSubscriptionData.cs
new file mode 100644
index 000000000..2c1a33461
--- /dev/null
+++ b/src/Discord.Net.Core/Entities/Messages/MessageRoleSubscriptionData.cs
@@ -0,0 +1,35 @@
+namespace Discord;
+
+///
+/// Represents a role subscription data in .
+///
+public class MessageRoleSubscriptionData
+{
+ ///
+ /// Gets the id of the sku and listing that the user is subscribed to.
+ ///
+ public ulong Id { get; }
+
+ ///
+ /// Gets the name of the tier that the user is subscribed to.
+ ///
+ public string TierName { get; }
+
+ ///
+ /// Gets the cumulative number of months that the user has been subscribed for.
+ ///
+ public int MonthsSubscribed { get; }
+
+ ///
+ /// Gets whether this notification is for a renewal rather than a new purchase.
+ ///
+ public bool IsRenewal { get; }
+
+ internal MessageRoleSubscriptionData(ulong id, string tierName, int monthsSubscribed, bool isRenewal)
+ {
+ Id = id;
+ TierName = tierName;
+ MonthsSubscribed = monthsSubscribed;
+ IsRenewal = isRenewal;
+ }
+}
diff --git a/src/Discord.Net.Rest/API/Common/Message.cs b/src/Discord.Net.Rest/API/Common/Message.cs
index d33a03fe5..f42a23b65 100644
--- a/src/Discord.Net.Rest/API/Common/Message.cs
+++ b/src/Discord.Net.Rest/API/Common/Message.cs
@@ -62,5 +62,7 @@ namespace Discord.API
public Optional Interaction { get; set; }
[JsonProperty("sticker_items")]
public Optional StickerItems { get; set; }
+ [JsonProperty("role_subscription_data")]
+ public Optional RoleSubscriptionData { get; set; }
}
}
diff --git a/src/Discord.Net.Rest/API/Common/MessageRoleSubscriptionData.cs b/src/Discord.Net.Rest/API/Common/MessageRoleSubscriptionData.cs
new file mode 100644
index 000000000..da97ec6b5
--- /dev/null
+++ b/src/Discord.Net.Rest/API/Common/MessageRoleSubscriptionData.cs
@@ -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; }
+}
diff --git a/src/Discord.Net.Rest/Entities/Messages/RestMessage.cs b/src/Discord.Net.Rest/Entities/Messages/RestMessage.cs
index 8b6b44e39..dfc814678 100644
--- a/src/Discord.Net.Rest/Entities/Messages/RestMessage.cs
+++ b/src/Discord.Net.Rest/Entities/Messages/RestMessage.cs
@@ -80,6 +80,9 @@ namespace Discord.Rest
///
public MessageType Type { get; private set; }
+ ///
+ public MessageRoleSubscriptionData RoleSubscriptionData { get; private set; }
+
///
public IReadOnlyCollection Components { get; private set; }
///
@@ -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);
+ }
}
///
public async Task UpdateAsync(RequestOptions options = null)
diff --git a/src/Discord.Net.WebSocket/Entities/Messages/SocketMessage.cs b/src/Discord.Net.WebSocket/Entities/Messages/SocketMessage.cs
index 40a645afb..df7d91bd0 100644
--- a/src/Discord.Net.WebSocket/Entities/Messages/SocketMessage.cs
+++ b/src/Discord.Net.WebSocket/Entities/Messages/SocketMessage.cs
@@ -78,6 +78,9 @@ namespace Discord.WebSocket
///
public MessageType Type { get; private set; }
+ ///
+ public MessageRoleSubscriptionData RoleSubscriptionData { get; private set; }
+
///
/// Returns all attachments included in this message.
///
@@ -271,6 +274,15 @@ namespace Discord.WebSocket
if (model.Flags.IsSpecified)
Flags = model.Flags.Value;
+
+ if (model.RoleSubscriptionData.IsSpecified)
+ {
+ RoleSubscriptionData = new(
+ model.RoleSubscriptionData.Value.SubscriptionListingId,
+ model.RoleSubscriptionData.Value.TierName,
+ model.RoleSubscriptionData.Value.MonthsSubscribed,
+ model.RoleSubscriptionData.Value.IsRenewal);
+ }
}
///