Skip to content

Commit

Permalink
fix: incomplete validation when ChannelFlags.RequireTag is true (#2962)
Browse files Browse the repository at this point in the history
  • Loading branch information
itsCristianPro7 authored Jul 20, 2024
1 parent 26bb789 commit f5fdfb2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Discord.Net.Rest/Entities/Channels/ThreadHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ public static async Task<RestThreadChannel> CreatePostAsync(IForumChannel channe
throw new ArgumentException("The only valid MessageFlags are SuppressEmbeds and none.", nameof(flags));

if (channel.Flags.HasFlag(ChannelFlags.RequireTag))
throw new ArgumentException($"The channel {channel.Name} requires posts to have at least one tag.");
{
Preconditions.AtLeast(tagIds?.Length ?? 0, 1, nameof(tagIds), $"The channel {channel.Name} requires posts to have at least one tag.");
}

var args = new CreateMultipartPostAsync(attachments.ToArray())
{
Expand Down

0 comments on commit f5fdfb2

Please sign in to comment.