diff --git a/src/Discord.Net.Core/Entities/Channels/ForumChannelProperties.cs b/src/Discord.Net.Core/Entities/Channels/ForumChannelProperties.cs
index 1704dc32..eb18d392 100644
--- a/src/Discord.Net.Core/Entities/Channels/ForumChannelProperties.cs
+++ b/src/Discord.Net.Core/Entities/Channels/ForumChannelProperties.cs
@@ -31,7 +31,7 @@ public class ForumChannelProperties : TextChannelProperties
///
/// Gets or sets a collection of tags inside of this forum channel.
///
- public Optional> Tags { get; set; }
+ public Optional> Tags { get; set; }
///
/// Gets or sets a new default reaction emoji in this forum channel.
diff --git a/src/Discord.Net.Core/Entities/ForumTags/ForumTag.cs b/src/Discord.Net.Core/Entities/ForumTags/ForumTag.cs
index 1527356a..87d306d3 100644
--- a/src/Discord.Net.Core/Entities/ForumTags/ForumTag.cs
+++ b/src/Discord.Net.Core/Entities/ForumTags/ForumTag.cs
@@ -1,67 +1,62 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
#nullable enable
-namespace Discord
+namespace Discord;
+
+///
+/// A struct representing a forum channel tag.
+///
+public readonly struct ForumTag : ISnowflakeEntity, IForumTag
{
- ///
- /// A struct representing a forum channel tag.
- ///
- public struct ForumTag : ISnowflakeEntity, IForumTag
+ ///
+ public ulong Id { get; }
+
+ ///
+ public string Name { get; }
+
+ ///
+ public IEmote? Emoji { get; }
+
+ ///
+ public bool IsModerated { get; }
+
+ ///
+ public DateTimeOffset CreatedAt => SnowflakeUtils.FromSnowflake(Id);
+
+ internal ForumTag(ulong id, string name, ulong? emojiId = null, string? emojiName = null, bool moderated = false)
{
- ///
- /// Gets the Id of the tag.
- ///
- public ulong Id { get; }
+ if (emojiId.HasValue && emojiId.Value != 0)
+ Emoji = new Emote(emojiId.Value, null, false);
+ else if (emojiName != null)
+ Emoji = new Emoji(emojiName);
+ else
+ Emoji = null;
- ///
- public string Name { get; }
-
- ///
- public IEmote? Emoji { get; }
-
- ///
- public bool IsModerated { get; }
-
- ///
- public DateTimeOffset CreatedAt => SnowflakeUtils.FromSnowflake(Id);
-
- internal ForumTag(ulong id, string name, ulong? emojiId = null, string? emojiName = null, bool moderated = false)
- {
- if (emojiId.HasValue && emojiId.Value != 0)
- Emoji = new Emote(emojiId.Value, null, false);
- else if (emojiName != null)
- Emoji = new Emoji(emojiName);
- else
- Emoji = null;
-
- Id = id;
- Name = name;
- IsModerated = moderated;
- }
-
- public override int GetHashCode() => (Id, Name, Emoji, IsModerated).GetHashCode();
-
- public override bool Equals(object? obj)
- => obj is ForumTag tag && Equals(tag);
-
- ///
- /// Gets whether supplied tag is equals to the current one.
- ///
- public bool Equals(ForumTag tag)
- => Id == tag.Id &&
- Name == tag.Name &&
- (Emoji is Emoji emoji && tag.Emoji is Emoji otherEmoji && emoji.Equals(otherEmoji) ||
- Emoji is Emote emote && tag.Emoji is Emote otherEmote && emote.Equals(otherEmote)) &&
- IsModerated == tag.IsModerated;
-
- public static bool operator ==(ForumTag? left, ForumTag? right)
- => left?.Equals(right) ?? right is null;
-
- public static bool operator !=(ForumTag? left, ForumTag? right) => !(left == right);
+ Id = id;
+ Name = name;
+ IsModerated = moderated;
}
+
+ public override int GetHashCode() => (Id, Name, Emoji, IsModerated).GetHashCode();
+
+ public override bool Equals(object? obj)
+ => obj is ForumTag tag && Equals(tag);
+
+ ///
+ /// Gets whether supplied tag is equals to the current one.
+ ///
+ public bool Equals(ForumTag tag)
+ => Id == tag.Id &&
+ Name == tag.Name &&
+ (Emoji is Emoji emoji && tag.Emoji is Emoji otherEmoji && emoji.Equals(otherEmoji) ||
+ Emoji is Emote emote && tag.Emoji is Emote otherEmote && emote.Equals(otherEmote)) &&
+ IsModerated == tag.IsModerated;
+
+ public static bool operator ==(ForumTag? left, ForumTag? right)
+ => left?.Equals(right) ?? right is null;
+
+ public static bool operator !=(ForumTag? left, ForumTag? right) => !(left == right);
+
+ ///
+ readonly ulong? IForumTag.Id => Id;
}
diff --git a/src/Discord.Net.Core/Entities/ForumTags/ForumTagBuilder.cs b/src/Discord.Net.Core/Entities/ForumTags/ForumTagBuilder.cs
index 8ba3eff6..f0a21887 100644
--- a/src/Discord.Net.Core/Entities/ForumTags/ForumTagBuilder.cs
+++ b/src/Discord.Net.Core/Entities/ForumTags/ForumTagBuilder.cs
@@ -124,8 +124,8 @@ public class ForumTagBuilder
public ForumTagProperties Build()
{
if (_name is null)
- throw new ArgumentNullException(nameof(Name), "Name must be set to build the tag");
- return new ForumTagProperties(_name!, _emoji, _moderated);
+ throw new ArgumentNullException(nameof(Name), "Name must be set to build the tag.");
+ return new ForumTagProperties(_id, _name, _emoji, _moderated);
}
///
diff --git a/src/Discord.Net.Core/Entities/ForumTags/ForumTagProperties.cs b/src/Discord.Net.Core/Entities/ForumTags/ForumTagProperties.cs
index 6ded4920..3dd7bdab 100644
--- a/src/Discord.Net.Core/Entities/ForumTags/ForumTagProperties.cs
+++ b/src/Discord.Net.Core/Entities/ForumTags/ForumTagProperties.cs
@@ -7,7 +7,7 @@ public class ForumTagProperties : IForumTag
///
/// Gets the Id of the tag.
///
- public ulong Id { get; }
+ public ulong? Id { get; }
///
public string Name { get; }
@@ -18,11 +18,12 @@ public class ForumTagProperties : IForumTag
///
public bool IsModerated { get; }
- internal ForumTagProperties(string name, IEmote? emoji = null, bool isMmoderated = false)
+ internal ForumTagProperties(ulong? id, string name, IEmote? emoji = null, bool isModerated = false)
{
+ Id = id;
Name = name;
Emoji = emoji;
- IsModerated = isMmoderated;
+ IsModerated = isModerated;
}
public override int GetHashCode() => (Id, Name, Emoji, IsModerated).GetHashCode();
diff --git a/src/Discord.Net.Core/Entities/ForumTags/IForumTag.cs b/src/Discord.Net.Core/Entities/ForumTags/IForumTag.cs
index 8b8b866b..4e10ff31 100644
--- a/src/Discord.Net.Core/Entities/ForumTags/IForumTag.cs
+++ b/src/Discord.Net.Core/Entities/ForumTags/IForumTag.cs
@@ -7,6 +7,14 @@ namespace Discord;
///
public interface IForumTag
{
+ ///
+ /// Gets the Id of the tag.
+ ///
+ ///
+ /// This property may be if the object is .
+ ///
+ ulong? Id { get; }
+
///
/// Gets the name of the tag.
///
diff --git a/src/Discord.Net.Rest/API/Rest/CreateMultipartPostAsync.cs b/src/Discord.Net.Rest/API/Rest/CreateMultipartPostAsync.cs
index bb10a468..14e5f538 100644
--- a/src/Discord.Net.Rest/API/Rest/CreateMultipartPostAsync.cs
+++ b/src/Discord.Net.Rest/API/Rest/CreateMultipartPostAsync.cs
@@ -46,6 +46,8 @@ namespace Discord.API.Rest
if (Slowmode.IsSpecified)
payload["rate_limit_per_user"] = Slowmode.Value;
+ if (TagIds.IsSpecified)
+ payload["applied_tags"] = TagIds.Value;
// message
if (Content.IsSpecified)
@@ -60,8 +62,6 @@ namespace Discord.API.Rest
message["sticker_ids"] = Stickers.Value;
if (Flags.IsSpecified)
message["flags"] = Flags.Value;
- if (TagIds.IsSpecified)
- message["applied_tags"] = TagIds.Value;
List