From de404b2df9787e58880564f609271a78d15610bf Mon Sep 17 00:00:00 2001 From: Floowey Date: Thu, 18 Nov 2021 10:18:42 +0100 Subject: [PATCH] Fix maximum number of Select Menu Options (#282) As of https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-menu-structure the maximum number of options is 25, not less than 25. Hopefully the change catches all necessary locations --- .../Interactions/MessageComponents/ComponentBuilder.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ComponentBuilder.cs b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ComponentBuilder.cs index 48e18f29a..fd96d30c6 100644 --- a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ComponentBuilder.cs +++ b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ComponentBuilder.cs @@ -650,7 +650,7 @@ namespace Discord get => _minValues; set { - Preconditions.LessThan(value, MaxValuesCount, nameof(MinValues)); + Preconditions.AtMost(value, MaxValuesCount, nameof(MinValues)); _minValues = value; } } @@ -664,7 +664,7 @@ namespace Discord get => _maxValues; set { - Preconditions.LessThan(value, MaxValuesCount, nameof(MaxValues)); + Preconditions.AtMost(value, MaxValuesCount, nameof(MaxValues)); _maxValues = value; } } @@ -680,7 +680,7 @@ namespace Discord set { if (value != null) - Preconditions.LessThan(value.Count, MaxOptionCount, nameof(Options)); + Preconditions.AtMost(value.Count, MaxOptionCount, nameof(Options)); else throw new ArgumentNullException(nameof(value), $"{nameof(Options)} cannot be null.");