diff --git a/src/Discord.Net.Rest/Entities/Channels/ThreadHelper.cs b/src/Discord.Net.Rest/Entities/Channels/ThreadHelper.cs index 29be16cb..130270a0 100644 --- a/src/Discord.Net.Rest/Entities/Channels/ThreadHelper.cs +++ b/src/Discord.Net.Rest/Entities/Channels/ThreadHelper.cs @@ -146,12 +146,14 @@ namespace Discord.Rest Preconditions.AtMost(stickers.Length, 3, nameof(stickers), "A max of 3 stickers are allowed."); } - if (flags is not MessageFlags.None and not MessageFlags.SuppressEmbeds) - throw new ArgumentException("The only valid MessageFlags are SuppressEmbeds and none.", nameof(flags)); + if (components?.Components?.Any(x => x.Type != ComponentType.ActionRow) ?? false) + flags |= MessageFlags.ComponentsV2; + Preconditions.ValidateMessageFlags(flags); if (channel.Flags.HasFlag(ChannelFlags.RequireTag)) Preconditions.AtLeast(tagIds?.Length ?? 0, 1, nameof(tagIds), $"The channel {channel.Name} requires posts to have at least one tag."); + var args = new CreatePostParams() { Title = title, diff --git a/src/Discord.Net.Rest/Entities/Interactions/InteractionHelper.cs b/src/Discord.Net.Rest/Entities/Interactions/InteractionHelper.cs index ce07a294..77dd0523 100644 --- a/src/Discord.Net.Rest/Entities/Interactions/InteractionHelper.cs +++ b/src/Discord.Net.Rest/Entities/Interactions/InteractionHelper.cs @@ -432,6 +432,7 @@ namespace Discord.Rest Components = args.Components.IsSpecified ? args.Components.Value?.Components.Select(x => x.ToModel()).ToArray() ?? [] : Optional.Unspecified, + Flags = args.Flags }; return client.ApiClient.ModifyInteractionFollowupMessageAsync(apiArgs, message.Id, message.Token, options); @@ -494,7 +495,10 @@ namespace Discord.Rest Embeds = apiEmbeds?.ToArray() ?? Optional.Unspecified, AllowedMentions = args.AllowedMentions.IsSpecified ? args.AllowedMentions.Value?.ToModel() : Optional.Unspecified, MessageComponents = args.Components.IsSpecified - ? args.Components.Value?.Components.Select(x => x.ToModel()).ToArray() ?? [] : Optional.Unspecified + ? args.Components.Value?.Components.Select(x => x.ToModel()).ToArray() ?? [] : Optional.Unspecified, + Flags = args.Flags.IsSpecified + ? (args.Flags.Value ?? Optional.Unspecified) + : Optional.Unspecified }; return client.ApiClient.ModifyInteractionResponseAsync(apiArgs, token, options);