| @@ -26,7 +26,13 @@ namespace Discord | |||||
| /// </summary> | /// </summary> | ||||
| public IEmote Emoji { get; } | public IEmote Emoji { get; } | ||||
| internal ForumTag(ulong id, string name, ulong? emojiId, string emojiName) | |||||
| /// <summary> | |||||
| /// Gets whether this tag can only be added to or removed from threads by a member | |||||
| /// with the <see cref="GuildPermissions.ManageThreads"/> permission | |||||
| /// </summary> | |||||
| public bool Moderated { get; } | |||||
| internal ForumTag(ulong id, string name, ulong? emojiId, string emojiName, bool moderated) | |||||
| { | { | ||||
| if (emojiId.HasValue && emojiId.Value != 0) | if (emojiId.HasValue && emojiId.Value != 0) | ||||
| Emoji = new Emote(emojiId.Value, emojiName, false); | Emoji = new Emote(emojiId.Value, emojiName, false); | ||||
| @@ -37,6 +43,7 @@ namespace Discord | |||||
| Id = id; | Id = id; | ||||
| Name = name; | Name = name; | ||||
| Moderated = moderated; | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -17,5 +17,8 @@ namespace Discord.API | |||||
| public Optional<ulong?> EmojiId { get; set; } | public Optional<ulong?> EmojiId { get; set; } | ||||
| [JsonProperty("emoji_name")] | [JsonProperty("emoji_name")] | ||||
| public Optional<string> EmojiName { get; set; } | public Optional<string> EmojiName { get; set; } | ||||
| [JsonProperty("moderated")] | |||||
| public bool Moderated { get; set; } | |||||
| } | } | ||||
| } | } | ||||
| @@ -62,7 +62,7 @@ namespace Discord.Rest | |||||
| ThreadCreationInterval = model.SlowMode.Value; | ThreadCreationInterval = model.SlowMode.Value; | ||||
| Tags = model.ForumTags.GetValueOrDefault(Array.Empty<API.ForumTags>()).Select( | Tags = model.ForumTags.GetValueOrDefault(Array.Empty<API.ForumTags>()).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(); | ).ToImmutableArray(); | ||||
| } | } | ||||
| @@ -59,7 +59,7 @@ namespace Discord.WebSocket | |||||
| ThreadCreationInterval = model.SlowMode.Value; | ThreadCreationInterval = model.SlowMode.Value; | ||||
| Tags = model.ForumTags.GetValueOrDefault(Array.Empty<API.ForumTags>()).Select( | Tags = model.ForumTags.GetValueOrDefault(Array.Empty<API.ForumTags>()).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(); | ).ToImmutableArray(); | ||||
| } | } | ||||