diff --git a/src/Discord.Net.Core/Entities/ForumTag.cs b/src/Discord.Net.Core/Entities/ForumTag.cs index 26ae4301e..8c17453d5 100644 --- a/src/Discord.Net.Core/Entities/ForumTag.cs +++ b/src/Discord.Net.Core/Entities/ForumTag.cs @@ -26,7 +26,13 @@ namespace Discord /// public IEmote Emoji { get; } - internal ForumTag(ulong id, string name, ulong? emojiId, string emojiName) + /// + /// Gets whether this tag can only be added to or removed from threads by a member + /// with the permission + /// + public bool Moderated { get; } + + internal ForumTag(ulong id, string name, ulong? emojiId, string emojiName, bool moderated) { if (emojiId.HasValue && emojiId.Value != 0) Emoji = new Emote(emojiId.Value, emojiName, false); @@ -37,6 +43,7 @@ namespace Discord Id = id; Name = name; + Moderated = moderated; } } } diff --git a/src/Discord.Net.Rest/API/Common/ForumTags.cs b/src/Discord.Net.Rest/API/Common/ForumTags.cs index 18354e7b2..c4a1fa2a2 100644 --- a/src/Discord.Net.Rest/API/Common/ForumTags.cs +++ b/src/Discord.Net.Rest/API/Common/ForumTags.cs @@ -17,5 +17,8 @@ namespace Discord.API public Optional EmojiId { get; set; } [JsonProperty("emoji_name")] public Optional EmojiName { get; set; } + + [JsonProperty("moderated")] + public bool Moderated { get; set; } } } diff --git a/src/Discord.Net.Rest/Entities/Channels/RestForumChannel.cs b/src/Discord.Net.Rest/Entities/Channels/RestForumChannel.cs index df42d0394..03bb276b9 100644 --- a/src/Discord.Net.Rest/Entities/Channels/RestForumChannel.cs +++ b/src/Discord.Net.Rest/Entities/Channels/RestForumChannel.cs @@ -62,7 +62,7 @@ namespace Discord.Rest ThreadCreationInterval = model.SlowMode.Value; Tags = model.ForumTags.GetValueOrDefault(Array.Empty()).Select( - x => new ForumTag(x.Id, x.Name, x.EmojiId.GetValueOrDefault(null), x.EmojiName.GetValueOrDefault()) + x => new ForumTag(x.Id, x.Name, x.EmojiId.GetValueOrDefault(null), x.EmojiName.GetValueOrDefault(), x.Moderated) ).ToImmutableArray(); } diff --git a/src/Discord.Net.WebSocket/Entities/Channels/SocketForumChannel.cs b/src/Discord.Net.WebSocket/Entities/Channels/SocketForumChannel.cs index 4250a7057..aa4ccb9ae 100644 --- a/src/Discord.Net.WebSocket/Entities/Channels/SocketForumChannel.cs +++ b/src/Discord.Net.WebSocket/Entities/Channels/SocketForumChannel.cs @@ -59,7 +59,7 @@ namespace Discord.WebSocket ThreadCreationInterval = model.SlowMode.Value; Tags = model.ForumTags.GetValueOrDefault(Array.Empty()).Select( - x => new ForumTag(x.Id, x.Name, x.EmojiId.GetValueOrDefault(null), x.EmojiName.GetValueOrDefault()) + x => new ForumTag(x.Id, x.Name, x.EmojiId.GetValueOrDefault(null), x.EmojiName.GetValueOrDefault(), x.Moderated) ).ToImmutableArray(); }