no fun for ya all (#2835)

This commit is contained in:
Mihail Gribkov
2024-02-11 23:47:43 +03:00
committed by GitHub
parent 942df4a981
commit 4d7e384e51

View File

@@ -1363,6 +1363,16 @@ namespace Discord
/// <returns>The newly built <see cref="SelectMenuOption"/>.</returns>
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);
}
}