diff --git a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ComponentBuilder.cs b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ComponentBuilder.cs index 1637bb17..ba9e6064 100644 --- a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ComponentBuilder.cs +++ b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ComponentBuilder.cs @@ -1363,6 +1363,16 @@ namespace Discord /// The newly built . public SelectMenuOption Build() { + if (string.IsNullOrWhiteSpace(Label)) + throw new ArgumentNullException(nameof(Label), "Option must have a label."); + + Preconditions.AtMost(Label.Length, MaxSelectLabelLength, nameof(Label), $"Label length must be less or equal to {MaxSelectLabelLength}."); + + if (string.IsNullOrWhiteSpace(Value)) + throw new ArgumentNullException(nameof(Value), "Option must have a value."); + + Preconditions.AtMost(Value.Length, MaxSelectValueLength, nameof(Value), $"Value length must be less or equal to {MaxSelectValueLength}."); + return new SelectMenuOption(Label, Value, Description, Emote, IsDefault); } }