Skip to content

Commit

Permalink
no fun for ya all (#2835)
Browse files Browse the repository at this point in the history
  • Loading branch information
Misha-133 committed Feb 11, 2024
1 parent 942df4a commit 4d7e384
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1363,6 +1363,16 @@ public SelectMenuOptionBuilder WithDefault(bool isDefault)
/// <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);
}
}
Expand Down

0 comments on commit 4d7e384

Please sign in to comment.