diff --git a/src/Discord.Net.Core/Entities/Channels/IThreadChannel.cs b/src/Discord.Net.Core/Entities/Channels/IThreadChannel.cs index f03edbbf9..72afcad7f 100644 --- a/src/Discord.Net.Core/Entities/Channels/IThreadChannel.cs +++ b/src/Discord.Net.Core/Entities/Channels/IThreadChannel.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Threading.Tasks; namespace Discord @@ -56,6 +57,14 @@ namespace Discord /// bool? IsInvitable { get; } + /// + /// Gets ids of tags applied to a forum thread + /// + /// + /// This property is only available on forum threads. + /// + IReadOnlyCollection AppliedTags { get; } + /// /// Gets when the thread was created. /// diff --git a/src/Discord.Net.Core/Entities/Channels/TextChannelProperties.cs b/src/Discord.Net.Core/Entities/Channels/TextChannelProperties.cs index 2dceb025c..6c8c24420 100644 --- a/src/Discord.Net.Core/Entities/Channels/TextChannelProperties.cs +++ b/src/Discord.Net.Core/Entities/Channels/TextChannelProperties.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; namespace Discord { @@ -53,6 +54,11 @@ namespace Discord /// Gets or sets the auto archive duration. /// public Optional AutoArchiveDuration { get; set; } - + + /// + /// Gets or sets the tags applied to a forum thread + /// + public Optional> AppliedTags { get; set; } + } } diff --git a/src/Discord.Net.Rest/API/Common/Channel.cs b/src/Discord.Net.Rest/API/Common/Channel.cs index d9d7d469c..0bb0a152d 100644 --- a/src/Discord.Net.Rest/API/Common/Channel.cs +++ b/src/Discord.Net.Rest/API/Common/Channel.cs @@ -70,7 +70,10 @@ namespace Discord.API //ForumChannel [JsonProperty("available_tags")] public Optional ForumTags { get; set; } - + + [JsonProperty("applied_tags")] + public Optional AppliedTags { get; set; } + [JsonProperty("default_auto_archive_duration")] public Optional AutoArchiveDuration { get; set; } } diff --git a/src/Discord.Net.Rest/API/Rest/ModifyThreadParams.cs b/src/Discord.Net.Rest/API/Rest/ModifyThreadParams.cs index 8c9216c3f..53c1f4f5f 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyThreadParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyThreadParams.cs @@ -1,4 +1,5 @@ using Newtonsoft.Json; +using System.Collections.Generic; namespace Discord.API.Rest { @@ -18,5 +19,8 @@ namespace Discord.API.Rest [JsonProperty("rate_limit_per_user")] public Optional Slowmode { get; set; } + + [JsonProperty("applied_tags")] + public Optional> AppliedTags { get; set; } } } diff --git a/src/Discord.Net.Rest/Entities/Channels/RestThreadChannel.cs b/src/Discord.Net.Rest/Entities/Channels/RestThreadChannel.cs index c763a6660..35a17ec2d 100644 --- a/src/Discord.Net.Rest/Entities/Channels/RestThreadChannel.cs +++ b/src/Discord.Net.Rest/Entities/Channels/RestThreadChannel.cs @@ -37,6 +37,9 @@ namespace Discord.Rest /// public bool? IsInvitable { get; private set; } + /// + public IReadOnlyCollection AppliedTags { get; private set; } + /// public override DateTimeOffset CreatedAt { get; } @@ -77,6 +80,8 @@ namespace Discord.Rest MessageCount = model.MessageCount.GetValueOrDefault(0); Type = (ThreadType)model.Type; ParentChannelId = model.CategoryId.Value; + + AppliedTags = model.AppliedTags.GetValueOrDefault(Array.Empty()); } /// diff --git a/src/Discord.Net.Rest/Entities/Channels/ThreadHelper.cs b/src/Discord.Net.Rest/Entities/Channels/ThreadHelper.cs index f5fce5a50..1037329b9 100644 --- a/src/Discord.Net.Rest/Entities/Channels/ThreadHelper.cs +++ b/src/Discord.Net.Rest/Entities/Channels/ThreadHelper.cs @@ -57,7 +57,8 @@ namespace Discord.Rest Archived = args.Archived, AutoArchiveDuration = args.AutoArchiveDuration, Locked = args.Locked, - Slowmode = args.SlowModeInterval + Slowmode = args.SlowModeInterval, + AppliedTags = args.AppliedTags }; return await client.ApiClient.ModifyThreadAsync(channel.Id, apiArgs, options).ConfigureAwait(false); } diff --git a/src/Discord.Net.WebSocket/Entities/Channels/SocketThreadChannel.cs b/src/Discord.Net.WebSocket/Entities/Channels/SocketThreadChannel.cs index 78462b062..f9c0472f2 100644 --- a/src/Discord.Net.WebSocket/Entities/Channels/SocketThreadChannel.cs +++ b/src/Discord.Net.WebSocket/Entities/Channels/SocketThreadChannel.cs @@ -89,6 +89,9 @@ namespace Discord.WebSocket /// public bool? IsInvitable { get; private set; } + /// + public IReadOnlyCollection AppliedTags { get; private set; } + /// public override DateTimeOffset CreatedAt { get; } @@ -149,6 +152,8 @@ namespace Discord.WebSocket } HasJoined = model.ThreadMember.IsSpecified; + + AppliedTags = model.AppliedTags.GetValueOrDefault(Array.Empty()); } internal IReadOnlyCollection RemoveUsers(ulong[] users)