| @@ -1,4 +1,5 @@ | |||||
| using System; | using System; | ||||
| using System.Collections.Generic; | |||||
| using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
| namespace Discord | namespace Discord | ||||
| @@ -56,6 +57,14 @@ namespace Discord | |||||
| /// </remarks> | /// </remarks> | ||||
| bool? IsInvitable { get; } | bool? IsInvitable { get; } | ||||
| /// <summary> | |||||
| /// Gets ids of tags applied to a forum thread | |||||
| /// </summary> | |||||
| /// <remarks> | |||||
| /// This property is only available on forum threads. | |||||
| /// </remarks> | |||||
| IReadOnlyCollection<ulong> AppliedTags { get; } | |||||
| /// <summary> | /// <summary> | ||||
| /// Gets when the thread was created. | /// Gets when the thread was created. | ||||
| /// </summary> | /// </summary> | ||||
| @@ -1,4 +1,5 @@ | |||||
| using System; | using System; | ||||
| using System.Collections.Generic; | |||||
| namespace Discord | namespace Discord | ||||
| { | { | ||||
| @@ -53,6 +54,11 @@ namespace Discord | |||||
| /// Gets or sets the auto archive duration. | /// Gets or sets the auto archive duration. | ||||
| /// </summary> | /// </summary> | ||||
| public Optional<ThreadArchiveDuration> AutoArchiveDuration { get; set; } | public Optional<ThreadArchiveDuration> AutoArchiveDuration { get; set; } | ||||
| /// <summary> | |||||
| /// Gets or sets the tags applied to a forum thread | |||||
| /// </summary> | |||||
| public Optional<IEnumerable<ulong>> AppliedTags { get; set; } | |||||
| } | } | ||||
| } | } | ||||
| @@ -70,7 +70,10 @@ namespace Discord.API | |||||
| //ForumChannel | //ForumChannel | ||||
| [JsonProperty("available_tags")] | [JsonProperty("available_tags")] | ||||
| public Optional<ForumTags[]> ForumTags { get; set; } | public Optional<ForumTags[]> ForumTags { get; set; } | ||||
| [JsonProperty("applied_tags")] | |||||
| public Optional<ulong[]> AppliedTags { get; set; } | |||||
| [JsonProperty("default_auto_archive_duration")] | [JsonProperty("default_auto_archive_duration")] | ||||
| public Optional<ThreadArchiveDuration> AutoArchiveDuration { get; set; } | public Optional<ThreadArchiveDuration> AutoArchiveDuration { get; set; } | ||||
| } | } | ||||
| @@ -1,4 +1,5 @@ | |||||
| using Newtonsoft.Json; | using Newtonsoft.Json; | ||||
| using System.Collections.Generic; | |||||
| namespace Discord.API.Rest | namespace Discord.API.Rest | ||||
| { | { | ||||
| @@ -18,5 +19,8 @@ namespace Discord.API.Rest | |||||
| [JsonProperty("rate_limit_per_user")] | [JsonProperty("rate_limit_per_user")] | ||||
| public Optional<int> Slowmode { get; set; } | public Optional<int> Slowmode { get; set; } | ||||
| [JsonProperty("applied_tags")] | |||||
| public Optional<IEnumerable<ulong>> AppliedTags { get; set; } | |||||
| } | } | ||||
| } | } | ||||
| @@ -37,6 +37,9 @@ namespace Discord.Rest | |||||
| /// <inheritdoc/> | /// <inheritdoc/> | ||||
| public bool? IsInvitable { get; private set; } | public bool? IsInvitable { get; private set; } | ||||
| /// <inheritdoc/> | |||||
| public IReadOnlyCollection<ulong> AppliedTags { get; private set; } | |||||
| /// <inheritdoc cref="IThreadChannel.CreatedAt"/> | /// <inheritdoc cref="IThreadChannel.CreatedAt"/> | ||||
| public override DateTimeOffset CreatedAt { get; } | public override DateTimeOffset CreatedAt { get; } | ||||
| @@ -77,6 +80,8 @@ namespace Discord.Rest | |||||
| MessageCount = model.MessageCount.GetValueOrDefault(0); | MessageCount = model.MessageCount.GetValueOrDefault(0); | ||||
| Type = (ThreadType)model.Type; | Type = (ThreadType)model.Type; | ||||
| ParentChannelId = model.CategoryId.Value; | ParentChannelId = model.CategoryId.Value; | ||||
| AppliedTags = model.AppliedTags.GetValueOrDefault(Array.Empty<ulong>()); | |||||
| } | } | ||||
| /// <summary> | /// <summary> | ||||
| @@ -57,7 +57,8 @@ namespace Discord.Rest | |||||
| Archived = args.Archived, | Archived = args.Archived, | ||||
| AutoArchiveDuration = args.AutoArchiveDuration, | AutoArchiveDuration = args.AutoArchiveDuration, | ||||
| Locked = args.Locked, | Locked = args.Locked, | ||||
| Slowmode = args.SlowModeInterval | |||||
| Slowmode = args.SlowModeInterval, | |||||
| AppliedTags = args.AppliedTags | |||||
| }; | }; | ||||
| return await client.ApiClient.ModifyThreadAsync(channel.Id, apiArgs, options).ConfigureAwait(false); | return await client.ApiClient.ModifyThreadAsync(channel.Id, apiArgs, options).ConfigureAwait(false); | ||||
| } | } | ||||
| @@ -89,6 +89,9 @@ namespace Discord.WebSocket | |||||
| /// <inheritdoc/> | /// <inheritdoc/> | ||||
| public bool? IsInvitable { get; private set; } | public bool? IsInvitable { get; private set; } | ||||
| /// <inheritdoc/> | |||||
| public IReadOnlyCollection<ulong> AppliedTags { get; private set; } | |||||
| /// <inheritdoc cref="IThreadChannel.CreatedAt"/> | /// <inheritdoc cref="IThreadChannel.CreatedAt"/> | ||||
| public override DateTimeOffset CreatedAt { get; } | public override DateTimeOffset CreatedAt { get; } | ||||
| @@ -149,6 +152,8 @@ namespace Discord.WebSocket | |||||
| } | } | ||||
| HasJoined = model.ThreadMember.IsSpecified; | HasJoined = model.ThreadMember.IsSpecified; | ||||
| AppliedTags = model.AppliedTags.GetValueOrDefault(Array.Empty<ulong>()); | |||||
| } | } | ||||
| internal IReadOnlyCollection<SocketThreadUser> RemoveUsers(ulong[] users) | internal IReadOnlyCollection<SocketThreadUser> RemoveUsers(ulong[] users) | ||||