fix: incomplete validation when ChannelFlags.RequireTag is true (#2962)

This commit is contained in:
Cristian
2024-07-20 14:35:40 -06:00
committed by GitHub
parent 26bb789b0a
commit f5fdfb259b

View File

@@ -213,7 +213,9 @@ namespace Discord.Rest
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())
{